Repository navigation
Studio tests: take the hub source baseline when the first test starts, not at collection - #16430
Merged
Merged
Conversation
…, not at collection
Member
Author
|
@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. Swish! 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". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
(Python 3.13, g-r)fails on several unrelated PRs (#16413, #16414, #16415):The test reads
_INHERITED = os.environ.get(SOURCE_ENV)at module import, during collection. Collection goes on after that. Any module collected later that imports the app (for exampletests/test_liveness_reports_*.pywith a module-levelfrom main import ...) runsapply_hub_settings(), and that always writesUNSLOTH_STUDIO_HUB_SOURCE. The conftest fixture_restore_hub_settings_envthen correctly restores the value each test started with (huggingface), but the test compares it against the stale collection-time value (None). The fixture is right. The test's baseline is taken too early, and whether it fails depends on which files share the shard. #16236 made it compare against the inherited source, which made it sensitive to this.Change
The first test records the source env and the "other" source at the moment it starts. That is exactly what the fixture saves and restores. The second test compares against those, and fails with a clear message if it runs without the first one. Nothing else changes.
Testing
UNSLOTH_STUDIO_HUB_SOURCE=huggingfaceat import, the way the app import does.assert 'huggingface' == None;UNSLOTH_STUDIO_HUB_SOURCE=modelscopein the environment (the case Studio tests: compare the hub source restore against the inherited source #16236 was for): 2 passed.