Repository navigation
test(capture): wait for the status condition, not a fixed event-loop budget - #203
shroominic wants to merge 1 commit into
Conversation
…budget Closes #198. The Unit gate failed on protocol_capture_status_test.dart:123 with 'Expected: a value greater than or equal to <3> / Actual: <0>' on head a084d8f, while the same job passed on 018dd90 with the same test and the same app sources for this path. The test fired its heartbeat timer twice and then counted statuses after a fixed 40 event-loop turns; the status writer commits through real asynchronous work, so a loaded runner can finish those turns before the writes land. _pumpUntil() pumps in small chunks until the condition holds, bounded by a wall-clock timeout so a real hang still fails the following assertion with the real evidence. The strictly-advancing assertions are unchanged. Verification: - flutter test test/protocol_capture_status_test.dart 3/3 pass - flutter test test/ (483 tests) pass twice - dart format --set-exit-if-changed lib test integration_test exit 0
|
Verification note: the red checks on this PR are
This PR touches exactly one test file and no production code: Locally on this branch: |
|
Carried by the GS1 consolidation in PR #209 (branch feature/cbio-gs1, head 3eca4f4). This PR is contained in the consolidated line; the merge that carries it is c85f827. Closing as subsumed by the consolidation - not as won't fix. The per-defect evidence stays in this thread, and the carrying commit above is where the change now lives. |
Closes #198.
The defect
openhealth/test/protocol_capture_status_test.dartfired the heartbeat timer twice and then countedstatuses after a fixed 40 event-loop turns:
The status writer commits through real asynchronous work, so on a loaded runner those turns can
finish before the writes land. The Unit check — a required release gate — then fails on a test
budget rather than on a product contract:
Evidence that this is load-dependent and not a regression: the same Unit job passed on head
018dd90(run 35310179815 job 105490417714) and failed on the next heada084d8f(run 35312259964 job 105496537847), while
git diff --name-only 018dd906..a084d8ftouches no filethis test imports. Five consecutive local runs of the file, and two full local
test-unitruns,pass.
Change
_pumpUntil()pumps in small chunks until the condition holds, bounded by a wall-clock timeout so areal hang still fails the following assertion with the real evidence. The strictly-advancing
assertions this feeds are unchanged, and no production file is touched.
Verification
flutter test test/protocol_capture_status_test.dartflutter test test/dart format --output=none --set-exit-if-changedon the filescripts/flutter-workspace.sh format-check(all projects)Not covered
The publisher's behaviour is unchanged; this fixes the test's budget, not a product race. If a real
hang ever occurs, the assertion after
_pumpUntilstill fails loudly.