mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 15:08:24 +00:00
The availability test scraped the metrics endpoint three times with a 200 ms timer between requests to sample "during sync". The timer did not relate the samples to any sync state, so under load all three could land before the sync connection existed. Scrape once while the connection to the source is still being established, wait for the connection gauge to report it through the existing `wait_for_sync_connection` helper, and scrape again. The two samples now bracket the connection instead of being spaced by a timer. The remaining sleeps in this file are the intervals of bounded polls. Validation: measured against master with the same binaries, 20 unloaded runs and 30 samples as three concurrent instances under CPU spinners; see the pull request description. Assisted-by: Claude Fable 5.1 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>