ReviewOS

zig-utils/zig-js

Test: make cooperative nursery retry assertion scheduler-stable

#509
Closed chris opened this 9 days ago ·
9 days ago

Parent: #494 Related: #476

Problem

context.test.parallel_js: multi-age cooperative nursery retains old-owner graph asserts that gc_cooperative_timeouts is exactly zero. The cooperative collector intentionally uses a bounded 100 ms rendezvous and retries after a peer misses that deadline. Under a 10-shard Debug unit run this assertion failed twice (expected 0, found 2) while the graph, collection, parking, promotion, cleanup, and denominator invariants all completed.

A nearby moving-nursery test already documents the scheduler-stable contract: every elected attempt has exactly one terminal outcome, so attempts == collections + timeouts; the retry count depends on host scheduling.

Evidence

  • conservative 10-shard run: 1,530 passed, 1 expected platform skip, 1 failed, 0 leaked; 1,532/1,532 accounted; 608.7 s wall
  • prior history-LPT warmup: same test and assertion failed (expected 0, found 2)
  • successful multi-age collections, peer parks, promotion, final graph value, and clean collector/conductor state remained independently asserted

Acceptance

  • Preserve the multi-age collection, promotion, peer-park, graph-integrity, and cleanup assertions.
  • Assert exact cooperative terminal-outcome accounting relative to the test baseline instead of requiring zero bounded retries.
  • Pass focused repeats and the complete sharded unit gate with exact denominator/leak accounting.

Refs #494 and #476.

9 days ago

Implemented and landed on main as test(gc): stabilize sharded concurrency coverage.

The fix preserves successful collections, tenuring, peer parks, promotion, graph integrity, and clean conductor state, while accounting for the collector's documented bounded rendezvous retries (attempts == collections + timeouts). The adjacent caller-scope witness now uses the same scheduler-stable contract.

Validation:

  • focused Debug multi-age witness: 4/4 same-binary passes (8.5–8.8 s), 0 failures/leaks
  • focused TSan cooperative nursery: 2/2, 0 failures/leaks
  • full planned unit gate: 1,531 passed, 1 expected platform skip, 0 failed, 0 leaked; all 1,532 discovered tests accounted

Closed by 5624fcf. Refs #494 and #476.

Sign in to comment on this issue.