Skip to content

fix: serialize auth environment tests - #27879

Merged
jif-oai merged 1 commit into
mainfrom
jif/fix-pat-auth-env-test-flake
Jun 12, 2026
Merged

fix: serialize auth environment tests#27879
jif-oai merged 1 commit into
mainfrom
jif/fix-pat-auth-env-test-flake

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • serialize the remaining login tests that mutate or read the process-global auth environment
  • include Bedrock auth-manager tests in the existing codex_auth_env serial group

Root cause

The login unit-test binary runs tests concurrently. One test removed CODEX_ACCESS_TOKEN without joining the existing serial group, while several Bedrock tests constructed AuthManager and read that same process-global environment outside the group. An interleaving could restore a stale personal access token while another test was loading file-backed auth, causing the observed mismatched /whoami request count and related auth-state flakes.

Verification

  • just fmt
  • git diff --check
  • bazel test //codex-rs/login:login-unit-tests --nocache_test_results --runs_per_test=20 --test_output=errors (20/20 passed)
  • just test -p codex-login (135/135 passed)

@jif-oai
jif-oai force-pushed the jif/fix-pat-auth-env-test-flake branch from 4f58a4b to 7192731 Compare June 12, 2026 14:14
@jif-oai jif-oai changed the title [login] serialize access-token environment test [login] serialize auth environment tests Jun 12, 2026
@jif-oai jif-oai changed the title [login] serialize auth environment tests fix: serialize auth environment tests Jun 12, 2026
@jif-oai
jif-oai marked this pull request as ready for review June 12, 2026 14:16
@jif-oai
jif-oai merged commit b65fe3d into main Jun 12, 2026
30 checks passed
@jif-oai
jif-oai deleted the jif/fix-pat-auth-env-test-flake branch June 12, 2026 14:24
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants