Fixed flaky unit test (#5654)

This PR fixes a test that is sporadically failing in CI.

The problem is that two unit tests (the older `login_and_cancel_chatgpt`
and a recently added
`login_chatgpt_includes_forced_workspace_query_param`) exercise code
paths that start the login server. The server binds to a hard-coded
localhost port number, so attempts to start more than one server at the
same time will fail. If these two tests happen to run concurrently, one
of them will fail.

To fix this, I've added a simple mutex. We can use this same mutex for
future tests that use the same pattern.
This commit is contained in:
Eric Traut
2025-10-24 18:31:24 -05:00
committed by GitHub
parent 6af83d86ff
commit 0533bd2e7c
3 changed files with 7 additions and 0 deletions

1
codex-rs/Cargo.lock generated
View File

@@ -853,6 +853,7 @@ dependencies = [
"pretty_assertions",
"serde",
"serde_json",
"serial_test",
"tempfile",
"tokio",
"toml",