Repository navigation
Conversation
The master_port tests called get_open_port() without reserving the port, so a concurrent process could steal it before config construction; settle_port then stepped +37 by design (PR vllm-project#3803, issue vllm-project#3794) and the equality assertion failed. READY CI build #17710 hit this in test_master_port_env_takes_precedence_over_kwarg. - Precedence/stability tests now use fixed ports with availability frozen via monkeypatch, keeping the resolution logic under test deterministic. - The default-port availability test retries the resolve-and-bind sequence to ride out transient steals. - The settle_port stepping test keeps its real reserved socket. Signed-off-by: wangyu <410167048@qq.com>
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 usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
This PR matches CODEOWNERS paths: /tests/. Code owners: @NickCao Routing: @NickCao via CODEOWNERS @yenuo26, please review your own changes and leave a short self-review comment describing what you checked. PRs without author self-review may not be assigned a reviewer. Please take a look when you have a chance. If you would like an automated review, mention @vllm-omni-review-bot in a comment. |
Address the CodeQL finding on the previous commit: sockets in these tests no longer bind all interfaces. - The reserved-port helper binds 127.0.0.1; a held loopback bind still conflicts with settle_port's wildcard probe. - The stepped-candidate check now calls is_port_available itself instead of a raw bind: a raw loopback bind can pass while the port is held on another interface, which would make settle_port step again and break the assertion on multi-homed hosts. Validated on a shared host with ports held on both loopback and a non-loopback interface: 6/6 pass across repeated runs. Signed-off-by: wangyu <410167048@qq.com>
|
Self-review per the assignment request:
|
The stubbed default-port check only repeated that settle_port returns its first probe. Take the bounded loopback bind from vllm-project#9215, and require the env-precedence probe list to be exactly the env port. Signed-off-by: sheng <sheng.gao.dev@gmail.com>
Contributor intent (required human answers)
1. What outcome do you want to achieve?
Fix the READY CI failure in build #17710: eliminate the flaky failure of
test_master_port_env_takes_precedence_over_kwarg(AssertionError: assert 34510 == 34473) so READY CI builds stop failing on this pre-existing race. (Contributor's request: fix READY CI build #17710; the failure is pre-existing — the same contention signature appears in passing main builds and the failing test is outside PR #9046's diff.)2. What is the highest-leverage variable for that outcome?
Test determinism — whether the assertion depends on unreserved OS port state. The test's sensitivity to concurrent port steals directly decides whether this flake recurs. (Contributor's explicit answer: 测试确定性 / test determinism.)
3. How will this work move that variable?
The flaky tests obtained ports via
get_open_port()without reserving them, so a concurrent process could steal a port between selection and assertion;OmniDiffusionConfig.settle_portthen stepped +37 by design (PR #3803, issue #3794) and the equality assertion failed. This PR removes that dependency:settle_portstepping test keeps its real reserved socket and is unchanged.4. Whose customer or user needs does this address, and what are those needs?
Both (contributor's explicit answer: 两者都是):
Purpose
Before:
test_master_port_env_takes_precedence_over_kwarg(and the otherget_open_port()-based tests in this file) could fail whenever a concurrent process bound the selected ephemeral port betweenget_open_port()and config construction;settle_portsteps such a port by +37 by design, soassert config.master_port == env_portbroke (build #17710: 34473 stolen → stepped to 34510).After: those assertions are deterministic and independent of concurrent port state; the default-port test tolerates transient steals via bounded retry; the stepping test is unchanged.
Test-only change:
vllm_omni/diffusion/data.pyresolution behavior is untouched. No public configuration, defaults, or supported behavior changes, so no design contract or user-guide update is needed.Test Plan
vLLM Version: 0.32.0 (CI pin: commit
5df63a7203cdb9328d824a27b682e77c7b9928be; local validation used the v0.32.0 release wheel)vLLM-Omni Commit: main
95b1d97f2+ this PRTest Result
Mechanism reproduced on main code: with
MASTER_PORT=39001and port 39001 held by a concurrent process,OmniDiffusionConfig(model="test", master_port=39002)logsPort 39001 was unavailable, using port 39038 instead— the exact +37 stepping that producedassert 34510 == 34473in build #17710 (34473 + 37 = 34510).Validation of this PR's test file on a checkout of main
95b1d97f2(vllm 0.32.0, CPU,HF_HUB_OFFLINEunset to match CI):pytest tests/diffusion/test_omni_diffusion_config_master_port.py -v— 6/6 passedChecks not run locally: the full pre-commit hook set (mypy et al.);
ruff check,ruff format --check, andpy_compilepass. The complete READY CI suite runs on this PR.