test: a missed held-sync arrival fails its own test instead of hanging cleanup

Merged
AN
18h ago
+8-3

Main's CI on a6efa386 hit a 10-second hook timeout in quota poll serves its reading while runtime sync is held and dispose drains publication, then two later tests reported a leaked fetch mock. The test waited on an arrival signal for the held runtime write that nothing released on teardown, so if that write never reached the spy (most plausibly the request's detached advisory quota publication being superseded or refused, which production allows), the body waited forever and cleanup couldn't finish.

The arrival is now a lifetime gate: teardown opens it, and the body returns without touching the stopping plugin, so a missed arrival is reported as this test's own timeout and nothing cascades. Every assertion and deadline is unchanged; production code is unchanged.

Not reproduced naturally in 320 fresh processes on a6efa386 and 026fe85c (0 held-sync failures); a controlled missed-arrival injection reproduced the exact hook timeout and is red as a plain test timeout after the fix, with the two following tests green. Tracing showed the request served without waiting on any pool write.


Summary by cubic

Fixes a potential hang in the quota poll serves its reading while runtime sync is held and dispose drains publication test by converting the held-sync arrival wait into a lifetime gate, so a missed arrival times out this test alone instead of hanging teardown and leaking a fetch mock into later tests.

  • Teardown opens the arrival gate and stops the plugin; the test body returns early when no interception occurred.
  • All assertions, deadlines, and production code are unchanged.
  • A controlled missed-arrival injection confirmed the original 10-second hook timeout and downstream fallout, and now reports only the test's own 5-second body timeout.