Skip to content

Keep test_studio_root_resilience on the backend's utils and loggers - #15165

Merged
danielhanchen merged 1 commit into
mainfrom
ci-studio-root-foreign-utils
Oct 24, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-studio-root-foreign-utils

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

tests/test_studio_root_resilience.py fails in the Repo tests (CPU, rest) shard (#15159, #15161) but passes on its own:

studio/backend/loggers/handlers.py:22: in <module>
    from utils.native_path_leases import redact_native_paths
E   ModuleNotFoundError: No module named 'utils.native_path_leases'

storage_roots.py imports the backend's loggers and utils by bare name. A dozen test modules in tests/ (the test_grpo_* family, test_nvfp4_loader.py and others) put tests/ at sys.path[0] when they are imported. After that, any bare import utils in the worker resolves to tests/utils. Logging sys.modules["utils"] after every test of a local run of the shard, on the same command line as CI (-n 4 --dist loadgroup), showed it switching to tests/utils/__init__.py partway through on two workers. Every later from utils.native_path_leases import ... then fails. The local run reproduced all three CI failures. The product code is fine. The test inherited whatever utils the worker had cached.

Change

  • _load() now takes monkeypatch. Before loading storage_roots.py it puts studio/backend first on sys.path and drops any cached utils* / loggers* module that does not live under studio/backend. monkeypatch puts everything back after the test, so the rest of the worker sees what it had before.
  • test_a_foreign_utils_left_by_another_test_does_not_answer: registers a stray utils package the way the shard does and checks that storage_roots.py still loads against the backend's own utils.

Verification

  • With this change: 8 passed alone, and 17 passed with test_cli_export_unpacking.py run between two copies of the file.
  • Sabotage: skipping the new isolation step makes the new test fail with CI's exact error (ModuleNotFoundError: No module named 'utils.native_path_leases').
  • The whole rest shard, run locally the way CI runs it, reproduced the three failures before the change.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 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-10-24T21:41:59.698739Z 95d4f79 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. 🎉

Reviewed commit: 95d4f79e1f

ℹ️ 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
danielhanchen merged commit 1128468 into main Oct 24, 2026
3 of 20 checks passed
@danielhanchen
danielhanchen deleted the ci-studio-root-foreign-utils branch October 24, 2026 21:53
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