Repository navigation
Fix the three Backend CI failures on main - #11111
Conversation
Backend CI has been red on main across several commits with three separate failures, one per shard. None of them is a real product defect in what the tests cover, but one is a real robustness defect next to it. tests/test_mcp_stdio_sessions.py::test_close_generation_keys_hold_no_secrets closed sessions that were never opened, so no close generation was recorded and its `assert gen_keys` guard was satisfied only by keys earlier tests in the file had left in two module-level maps that are never pruned. Under `--dist load`, which spreads one file across workers, it could run on a worker that left them empty. It now opens a session for the secret URL before each close and asserts on the keys that appear as a result. tests/test_scoped_download_job.py::test_a_full_snapshot_download_reports_no_file_list inherited a running scoped job for the same repo from whatever ran earlier in the process: the download registry is a process global and nothing resets it, and a running scoped job deliberately serializes a full snapshot of that repo, so the full row the test asks for is never created. An autouse fixture retires the repo's jobs around every test in the file. tests/test_account_tool_confinement.py::test_projects_home_under_a_granted_root_hides_other_accounts died with "Exception occurred in preexec_fn". _landlock_rules walks a granted ancestor child by child and the forked child opens each path afterwards, so a path removed in between raised out of preexec_fn and took the whole tool call with it. The tests race each other through the interpreter prefix, but production has the same window against a cache purge, a model delete or an account delete. Landlock denies by default, so a grant that vanished is now dropped rather than fatal, and a test covers that directly.
|
You have reached your Codex usage limits for security reviews. Please try again later. |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…icked Chat UI Tests (extra) has been failing at the same line on main and on a dozen branches since #10789 added the download-only pass: `Locator.click: Timeout 30000ms exceeded` on the klein row, and nothing else, because the 30 seconds are spent waiting on a row inside a menu that is no longer open. The picker dismisses on scroll, and this pass opens it with the Advanced panel expanded and two fields just filled, so a late re-render can close it in the frame after it opened. The open is now driven until the menu and the row are both there, without clicking an open picker shut, and the two failure shapes are told apart: a picker that will not stay open, and a picker that is open without the row in it. Either way the message names which.
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
* Fix the three Backend CI failures on main Backend CI has been red on main across several commits with three separate failures, one per shard. None of them is a real product defect in what the tests cover, but one is a real robustness defect next to it. tests/test_mcp_stdio_sessions.py::test_close_generation_keys_hold_no_secrets closed sessions that were never opened, so no close generation was recorded and its `assert gen_keys` guard was satisfied only by keys earlier tests in the file had left in two module-level maps that are never pruned. Under `--dist load`, which spreads one file across workers, it could run on a worker that left them empty. It now opens a session for the secret URL before each close and asserts on the keys that appear as a result. tests/test_scoped_download_job.py::test_a_full_snapshot_download_reports_no_file_list inherited a running scoped job for the same repo from whatever ran earlier in the process: the download registry is a process global and nothing resets it, and a running scoped job deliberately serializes a full snapshot of that repo, so the full row the test asks for is never created. An autouse fixture retires the repo's jobs around every test in the file. tests/test_account_tool_confinement.py::test_projects_home_under_a_granted_root_hides_other_accounts died with "Exception occurred in preexec_fn". _landlock_rules walks a granted ancestor child by child and the forked child opens each path afterwards, so a path removed in between raised out of preexec_fn and took the whole tool call with it. The tests race each other through the interpreter prefix, but production has the same window against a cache purge, a model delete or an account delete. Landlock denies by default, so a grant that vanished is now dropped rather than fatal, and a test covers that directly. * Reopen the image picker if it is dismissed before the klein row is clicked Chat UI Tests (extra) has been failing at the same line on main and on a dozen branches since unslothai#10789 added the download-only pass: `Locator.click: Timeout 30000ms exceeded` on the klein row, and nothing else, because the 30 seconds are spent waiting on a row inside a menu that is no longer open. The picker dismisses on scroll, and this pass opens it with the Advanced panel expanded and two fields just filled, so a late re-render can close it in the frame after it opened. The open is now driven until the menu and the row are both there, without clicking an open picker shut, and the two failure shapes are told apart: a picker that will not stay open, and a picker that is open without the row in it. Either way the message names which. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Backend CI has been red on main across several commits, with three separate failures, one per shard. Two are tests depending on process state they did not establish; the third is a real robustness defect in production, next to a test that raced it.
test_close_generation_keys_hold_no_secretsThe test closed sessions that were never opened.
close_mcp_sessionsrecords a close generation only when it closed something, so the maps stayed empty and theassert gen_keysguard, there to keep the secret check below it from passing over nothing, was satisfied only by keys earlier tests in the file had left behind._mcp_cfg_close_genand_mcp_url_close_genare module level and never pruned. Under--dist load, which spreads one file across workers, the test can run on a worker where nothing populated them.It now opens a session for the secret URL before each close and asserts on the keys that appear as a result, so it no longer depends on what ran before it.
test_a_full_snapshot_download_reports_no_file_listThe download registry is a process global and nothing resets it between tests, and a running scoped job deliberately serializes a full snapshot of the same repo, so the full row the test asks for is never created. Reproduced exactly, including the message, by leaving one scoped job running ahead of it.
Production is right to serialize, so the test must not inherit a running job. An autouse fixture retires that repo's jobs before and after every test in the file.
test_projects_home_under_a_granted_root_hides_other_accounts_landlock_ruleswalks a granted ancestor child by child, and_landlock_preexecopens each path afterwards in the forked child. A path removed in between madeos.openraise out ofpreexec_fn, taking the whole tool call with it and naming neither the path nor the reason.The tests race each other through the interpreter prefix, which is what made this land in CI, but the window is not test-only: a cache purge, a model delete or an account delete can remove a directory under a granted root while a tool call is starting, and the surrounding code already anticipates that class of race. Landlock denies by default, so dropping a grant only narrows the child, while raising kills the call. A vanished path is now skipped, and a test covers that directly by forking a child with a rule whose directory has already been removed.
Verification
Each fix was mutation tested:
The three files pass together under
-n 4. Five other failures in them are local to this workspace and are present on unmodified main: twoModuleNotFoundErrorfor modules this machine lacks, and three that assert on granted roots and pick up this workspace's own paths.