Files
ngit-grasp/tests
DanConwayDev b5a97e5df2 test(sync): wait on observable conditions with realistic deadlines
The tag_variations and live_sync suites waited for cross-relay
discovery with a fixed one-second sleep before publishing events, and
verified sync with five-second polls. On a loaded runner discovery can
take longer than the sleep, and events published before the syncing
relay subscribes are only recovered by later passes that miss the short
verification window. CI hit this on this PR's first run
(tag_variations uppercase-A), and different members of the same family
fail locally on different runs under load.

Discovery waits now use the existing wait_for_sync_connection helper
(bounded poll of the syncing relay's metrics endpoint) instead of a
sleep, the ordering test polls for each event instead of sleeping three
seconds, and verification deadlines widen to 30 seconds. Bounded polls
return as soon as the condition holds, so healthy runs are no slower;
only the failure bound moves.

Validated by running the sync suite repeatedly under a hostile git
config on a heavily loaded machine: the previously flaky tests pass in
every run. req_concurrency also flakes under such load at its phase-1
quiescence wait, but restructuring it needs an observable for
descendant-sweep completion that the relay does not yet expose, so it
is deliberately left unchanged (it has not flaked in CI).

Formatting fixes carried earlier in this branch were dropped: master
picked up equivalent rewraps via the relay-identity merge and is
fmt-clean again.
2026-08-15 11:39:13 +00:00
..
2026-08-12 14:43:38 +00:00