Repository navigation
test(providers): name the failing step again, share the bounded wait - #685
Conversation
`events_for_whole_body` folded its two expectations into one message when it moved onto `collect_events`, so a fixture that failed to parse and one that failed to finish panicked alike. Each step has its own message again. The two truncated-stream loopback tests each repeated the same wait: the client's result within `TRUNCATED_STREAM_BOUND`, then the server's only if the client returned. That is now one `client_then_server` helper, with the reason for skipping the second wait said once. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
jussielo-amd
left a comment
There was a problem hiding this comment.
Full review of the whole change.
This is a follow-up PR (not tied to a tracker issue) that implements both non-blocking notes juhovainio left on predecessor PR #659 — confirmed against that PR's actual review body, which names exactly: "a slightly loosened panic-message distinction in a test helper" and "a small duplicated 3-line shape between the two edited test functions."
Blocking
None
Non-blocking
None
Decisions for the author
None
Positive signals
client_then_server's doc comment states the reason for the conditional server wait ("a client that never returned already fails the test... so this does not spend a second bound waiting on a server it may never have reached") rather than restating what the code does.- Splitting
events_for_whole_body's single.expect("fixture stream parses and finishes")back into two distinct.expect()calls ("fixture lines parse"vs."fixture stream finishes") is a real, verifiable improvement: a panic now says which of the two phases failed, where before both phases collapsed into one ambiguous message.
Deployment notes
None — test-only change, no shipped behavior affected.
What this covered
Both changed files in full (apps/rocm/src/providers.rs's mod tests, apps/rocm/src/providers/proptests.rs), plus the call sites and surrounding context: collect_events's closure signature, served_request_within_bound, TRUNCATED_STREAM_BOUND, and both client_then_server call sites (confirmed the generic T resolves correctly at both: the chunked-stream test's (Result<String,String>, Vec<ProviderStreamEvent>) tuple, and the smoke-test's SmokeMetrics). Reviewed against 4629d531…15024345.
Verified directly, not just read:
- Built an isolated worktree off the PR head and ran
cargo test -p rocm providers::— all 39 tests pass, including the two refactored tests and everyproptests::*test that exercisesevents_for_whole_bodythrough the fixture list. - Ran
cargo clippy -p rocm --all-targetsin that worktree — clean. - Read CI via
gh pr checks 685— every required check passes; onlyE2E tests (MI300X)is still pending, unrelated to this change's scope. - Traced
collect_events's closure contract against the newevents_for_whole_bodybody to confirm the.expect()split still produces aResult<Vec<ProviderStreamEvent>>withfinish()'s error reaching the outer.expect, exactly as the panic-message intent requires. - Confirmed the description's claim against predecessor PR #659's actual, retrieved review body rather than trusting the PR text.
Did not run: mutation testing claimed in the PR description was not independently re-run; verified instead by reading the control flow (outcome.is_ok().then(...), served.transpose()) against both failure paths, which checks out.
Follow-up to #659, covering juhovainio's two non-blocking notes there.
events_for_whole_bodymoved ontocollect_events, its two expectations ("fixture lines parse" and "fixture stream finishes") became one message. Each step has its own message again, so a failure says whether the fixture failed to parse or failed to finish.TRUNCATED_STREAM_BOUND, then on the server only if the client returned. That is now oneclient_then_serverhelper.Checked by mutation:
Test-only change: no user-observable CLI behaviour changes, so no Gherkin scenario is needed (AGENTS.md §3).