Skip to content

Tests: shared rendezvous port helper and UTF-8 reads in newly added tests - #15716

Closed
danielhanchen wants to merge 2 commits into
mainfrom
tests-main-lint-fixes
Closed

danielhanchen wants to merge 2 commits into
mainfrom
tests-main-lint-fixes

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Three repo lint tests fail on current main (seen in Repo tests (CPU, rest) on staging runs of fresh main), from tests added in the last day:

  • test_rendezvous_port_everywhere.py::test_distributed_tests_take_their_port_from_the_shared_helper: tests/test_gc_skip_auto_dist_cells.py and tests/test_gc_skip_auto_dist_gloo.py (from checkpoint_skip_layers="auto" under torchrun: every rank keeps the smallest planned count #15545) define their own _free_port with socket.bind(("127.0.0.1", 0)) instead of tests._rendezvous_port.free_port().
  • test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding[3] and [14]: tests/test_refresh_moved_layer_devices.py:81 and tests/test_mamba_fused_lora_adapters.py:464 call read_text() without encoding = "utf-8".

Change

  • Both _free_port helpers now call tests._rendezvous_port.free_port(), the same two-line form the other distributed tests use, and the unused socket import is dropped.
  • The two reads pass encoding = "utf-8".

Test files only.

Tests

  • tests/test_rendezvous_port_everywhere.py and tests/test_source_read_encoding.py pass with this change.
  • tests/test_refresh_moved_layer_devices.py and tests/test_mamba_fused_lora_adapters.py pass.
  • The distributed cases in tests/test_gc_skip_auto_dist_*.py give the same result here as on unmodified main (5 failed, 9 passed in this CPU-only environment on both), so the port change does not alter them.

@danielhanchen danielhanchen self-assigned this Oct 28, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-28T09:00:48.609473Z 150948e 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.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 150948eaac

ℹ️ 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 that referenced this pull request Oct 28, 2026
…ugh run_pwsh (#15758)

## Summary

`Repo tests (CPU, studio)` fails on main, so it is red on every recent
staging CI run (#15680, #15696, #15716, #15723 and others). Of its 6
failures, 4 are tests that no longer match intentional changes; this PR
fixes those. The other 2 are real product slips on the login screen and
are fixed separately.

**Media picker contracts (3 failures).** #15726 lined the Images, Audio
and Video model pickers up with Chat:
- The picker now uses `className="ml-1.5 max-w-full overflow-hidden
!pl-2.5 !pr-1.5 !h-[var(--studio-chat-control-height,34px)]"`.
- It no longer sets a `triggerLabelClassName` override.

`tests/studio/test_desktop_reliability_frontend_contract.py` still
pinned the old class string and the old label override, and counted two
scaled `!h-[calc(34px*var(--ui-space-scale,1))]` literals on the Images
and Video pages (and one on Audio) that are now the shared token:

```
images-page.tsx states 1 scaled !h-34px, not 2
assert 'className="!h-[34px] max-w-full gap-1 ...' in header
```

**PowerShell spawn (1 failure).**
`tests/python/test_installer_compile_bytecode.py:271` (from #15646)
starts PowerShell with `subprocess.run`.
`tests/studio/test_pwsh_calls_use_the_shared_runner.py` forbids that,
because direct spawns share one PowerShell startup cache across xdist
workers and can die at startup.

## Change

- **`test_desktop_reliability_frontend_contract.py`:**
- The Images and Audio header contracts assert the new picker class
(`_MEDIA_PICKER_CLASS`), and that the label is not overridden, so the
trigger reads like Chat's.
- The scale table's `!h-34px` counts drop to what the pages still state
literally: Images 1, Audio 0, Video 1. The "no bare `!h-[34px]`" half of
that check is unchanged.
- New test `test_the_media_pickers_take_chats_scaled_control_height`:
all three pages use the picker class, and `index.css` still defines
`--studio-chat-control-height` as `calc(Npx * var(--ui-space-scale,
1))`. This keeps the original point of the scale check, a pill that
grows with the UI scale, attached to the token the height now comes
from.
- **`test_installer_compile_bytecode.py`:** the PowerShell case runs
through `run_pwsh` from `tests/_shared/unsloth_pwsh_runner.py`, with the
same argv and keyword arguments.

## Testing

- These three files: 80 passed (pwsh is installed here, so the
PowerShell cases really ran). On main, the same tests fail 4.
- **Sabotage:** with `--studio-chat-control-height` changed to a bare
`33px`, the new scaling test fails.
@danielhanchen

Copy link
Copy Markdown
Member Author

Closing: #15745 fixed the same three port and encoding guard failures on main.

@danielhanchen
danielhanchen deleted the tests-main-lint-fixes branch October 28, 2026 14:05
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