Skip to content

Tests: real-accelerator skip guards and utf-8 read in the gpt-oss and gc-skip tests - #14504

Merged
danielhanchen merged 1 commit into
mainfrom
fix-test-skip-guard-lint
Oct 21, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix-test-skip-guard-lint

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Repo tests (CPU, rest) and Repo tests (CPU, studio) fail on main and on every PR based on it. Three test files added by #14400 and #14404 trip the repo's own lint tests:

  • tests/python/test_accelerator_skip_guards.py::test_no_skip_guard_reads_a_spoofable_accelerator_probe: skip guards on torch.cuda.is_available(), which tests/_zoo_aggressive_cuda_spoof.py patches to True, so these tests un-skip on the CPU runners:
    • test_gpt_oss_bf16_load_in_4bit.py lines 99 and 160;
    • test_gpt_oss_bnb_checkpoint_layout.py line 191;
    • test_gc_skip_auto.py, 7 guards.
  • tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding[10]: test_gpt_oss_bnb_checkpoint_layout.py:362 opens a file without encoding.

Change

  • The guards use has_real_cuda() from tests/_shared/real_accelerator.py, as the other GPU tests do.
  • The open() call names encoding = "utf-8".

Test files only.

Validation

  • Both lint tests on CPU: 40 passed (they failed on main).
  • On a GPU, the three edited files on main and on this branch: 78 passed, 2 failed on both sides. has_real_cuda() and torch.cuda.is_available() agree on a real GPU, so the guards change nothing there. The two failures are the same tests on both sides (test_bf16_checkpoint_loads_real_weights_in_4bit, test_bf16_checkpoint_4bit_generate_matches_prefill) and are not touched here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 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-21T12:25:55.651878Z 8b693bb Manual request
🔒 Security Review ⚠️ Failed 2026-10-21T12:02:40.631432Z
We couldn’t complete this review. Comment @codex security review to try again.
8b693bb PR opened
ℹ️ 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.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 8b693bbf01

ℹ️ 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 c08dfbb into main Oct 21, 2026
@danielhanchen
danielhanchen deleted the fix-test-skip-guard-lint branch October 21, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant