Repository navigation
serve: the spawned mock's gates wait until it serves before their first request - #990
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: The readiness wait closes the startup race for all three callers without advancing the mock engine.
Non-blocking
⚠ Preserve recurrence and diagnosis coverage: crates/serve/tests/serve.rs:1266. Deleting the wait reopens the startup window; none of its three callers forces that window to occur.
Add a controlled delayed-handoff regression check and retain the stress reproduction as a tools probe, or explain why these fix layers are unnecessary. This makes a future regression reproducible.
Checked
Duplicates: 1 new item checked; no existing readiness-wait owner found. Dryer reported 0 pairs.
Complexity: crapper flagged no functions; the new loop has one readiness decision and explicit failure assertions.
Silent failure: 0 new suppression/default sites. Invalid JSON, unexpected replies and sustained loading fail explicitly.
Tests: no test definitions changed. Mutation analysis: deleting the wait restores intermittent failures; the PR reports before/after stress runs.
Gates: no existing threshold, assertion or case removed or relaxed; no pins moved.
Adversarial: health bypasses authentication and leaves the injected-failure counter unchanged; a failed wait drops the child through Reaped.
Performance: test harness only; no inference hot path changed.
Escape catalog: no patterns matched.
Notes
Static review only; the reported test runs were not rerun.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
serve 시험이 가끔 503 "Loading model"로 실패하던 경쟁을 고쳐, 시험이 서버가 요청을 받기 시작한 뒤에 첫 요청을 보내게 했습니다.
What and why
bloomery-serveprints its startup line right after it binds the listener. It only starts answering afterserver.run()takes the listener over, and until then every route replies 503loading. Thespawn_mockhelper incrates/serve/tests/serve.rsreturned the address as soon as it saw the startup line, so the first request ofhw_props_engine_object,a_key_never_reaches_what_the_process_prints_or_servesandhw_engine_error_is_500_then_503_then_exitsometimes reached the listener too early and got the 503.spawn_mocknow calls a newwait_served(addr)before it returns. It polls/healthuntil the server serves, accepts only a 503loadinganswer in between, and stops with a named assert on any other answer or on a timeout./healthneeds no API key, so the--api-keytest works too. The change touches only the test harness.Release notes: internal: the serve tests no longer race the server's startup, which made three tests fail intermittently.
Code shape
copying it (
AGENTS.md"Common code first",docs/rust-quality.mdR14). Where I found an existing copy, Inamed it below.
(tensor shapes, the attention kind, the quant). A common owner gained no per-model branch, flag or trait method.
tools/check-comments.sh).PIN(YYYY-MM-DD):and its reason.
cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": none.What I ran
The same loop ran 300 times before and after the fix. Each pass runs the three tests that use
spawn_mock:Before the fix, 11 of the 300 passes failed with the 503 body, 5 in
hw_props_engine_objectand 6 ina_key_never_reaches_what_the_process_prints_or_serves:After the fix, none failed:
The full serve test file passes after the fix:
rustfmt --edition 2024 --check crates/serve/tests/serve.rspasses with no output.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.