Skip to content

Flaky OAuth wildcard callback tests race on OAUTH_CALLBACK_HOST in CI #1280

Description

@henrypark133

Summary

The staging promotion PR hit an intermittent failure in Tests (default) on March 16, 2026 / March 17, 2026 UTC:

failures:
    llm::oauth_helpers::tests::bind_rejects_wildcard_ipv4

test result: FAILED. 3181 passed; 1 failed; 3 ignored; 0 measured; 0 filtered out; finished in 17.15s

error: test failed, to rerun pass `--lib`

Why this looks flaky

The exact failing test passes locally in isolation, and the related wildcard tests also pass locally when run together. The likely issue is that these tests mutate the process-global OAUTH_CALLBACK_HOST environment variable without synchronization:

  • src/llm/oauth_helpers.rs has tests bind_rejects_wildcard_ipv4 and bind_rejects_wildcard_ipv6 that call std::env::set_var / remove_var
  • the repo already has an ENV_MUTEX pattern in src/cli/oauth_defaults.rs for env-sensitive OAuth tests

That suggests a parallel test race rather than a real product regression or GitHub runner hiccup.

Suggested fix

Serialize the env-var-sensitive tests in src/llm/oauth_helpers.rs with the same mutex pattern already used in src/cli/oauth_defaults.rs, or otherwise refactor them to avoid mutating global process env during parallel test execution.

Notes

  • The failed job reached the Run Tests step successfully; this was not a setup/cache/download failure.
  • Other test/build matrix jobs around it were green, which also points away from infra failure.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingscope: ciCI/CD workflowsscope: llmLLM integrationstaging-ci-reviewIssue found during staging CI promotion reviewsuggested_P1Issue creator suggests Priority 1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions