Skip to content

Fix the three Backend CI failures on main - #11111

Merged
danielhanchen merged 3 commits into
mainfrom
fix/backend-ci-main-red-three
Sep 16, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
fix/backend-ci-main-red-three

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

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_secrets

FAILED tests/test_mcp_stdio_sessions.py::test_close_generation_keys_hold_no_secrets - assert []

The test closed sessions that were never opened. close_mcp_sessions records a close generation only when it closed something, so the maps stayed empty and the assert gen_keys guard, 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_gen and _mcp_url_close_gen are 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_list

FAILED tests/test_scoped_download_job.py::test_a_full_snapshot_download_reports_no_file_list
  AssertionError: no full-snapshot row in [ActiveDownload(repo_id='black-forest-labs/FLUX.1-dev',
  variant='@diffusion', ..., state='running', files=[...])]

The 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

FAILED tests/test_account_tool_confinement.py::test_projects_home_under_a_granted_root_hides_other_accounts
  AssertionError: Execution error: Exception occurred in preexec_fn.

_landlock_rules walks a granted ancestor child by child, and _landlock_preexec opens each path afterwards in the forked child. A path removed in between made os.open raise out of preexec_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:

Mutation Result
close keys stored raw instead of digested 1 failed
close generation never recorded 1 failed
a full snapshot publishes a file list 1 failed
vanished rule path raises instead of being skipped 1 failed

The three files pass together under -n 4. Five other failures in them are local to this workspace and are present on unmodified main: two ModuleNotFoundError for modules this machine lacks, and three that assert on granted roots and pick up this workspace's own paths.

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.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-16T13:07:53.065395Z a80c4c6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 686fbca00b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

danielhanchen and others added 2 commits September 16, 2026 12:16
…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.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: a80c4c6761

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

danielhanchen added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Sep 16, 2026
@danielhanchen
danielhanchen merged commit 1e6908d into main Sep 16, 2026
4 of 41 checks passed
@danielhanchen
danielhanchen deleted the fix/backend-ci-main-red-three branch September 16, 2026 13:17
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant