test(gateway): pin the waiter of a wait cancelled under a full job queue #6039
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 217 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.322
Real PR Conversation Timeline
1 comments
"Review active on #6039"
general
weight: 0.35
claude[bot]
Description
Problem
submit_and_waitremoves its waiter through a guard when the caller leaves by any path. One of the paths, a caller dropped while its submit is parked on a queue slot, had no test. The module's unit tests build the queue over a dropped context, so a submit returns at the context check before it parks.Solution
One unit test over the crate's test-only
AppContextbuilder and a capacity-one queue whose one slot the test holds. The wait is dropped while parked. The test reads the waiter under the key while the submit waits, gone after the drop, and a later caller's under the key.Changes
model_gateway/src/workflow/job_queue.rs: the testa_wait_cancelled_under_a_full_queue_leaves_no_waiter.Test Plan
cargo test -p smg --lib -- workflow::job_queue::tests: 21 passed, three runs.cargo clippy -p smg --all-targets -- -D warnings,cargo fmt --checkandcargo doc -p smgwith warnings denied: clean.job_queue.rsrestored after each. The guard created after the submit, the refused arm removing the waiter itself: the new test red at the drop. The guard dropped at once: the new test red while parked.Numbers
| measure | before | after |
|---|---|---|
| tests of a wait cancelled while the queue is full | 0 | 1 |
| job queue unit tests | 20 | 21 |
| mutants of the guard's placement the suite catches | 0 of 2 | 2 of 2 |
Release note
A test pins that a caller leaving a full job queue takes its waiter with it.