Files
ngit-grasp/tests
DanConwayDevandClaude Fable 5.1 4fd849cd8b test(common): await connection attempts in the event and client helpers
wait_for_event_on_relay built a fresh client on every poll, called
`Client::connect`, and slept 100 ms per status check before each fetch.
Every poll therefore cost a new WebSocket handshake plus at least one
fixed interval, and a missed status transition stalled a poll for a full
second. TestClient::connect used the same sleep-first loop.

Keep one connection for the whole wait and use `connect_client`, which
awaits the connection attempt through `try_connect`; poll the fetch at
the existing 200 ms interval with the existing 500 ms fetch window. Have
TestClient::connect use `try_connect` directly so a failed attempt
returns the SDK's reason instead of a generic timeout. Negated callers
that observe absence over a window keep their semantics: the helper
still returns false when nothing matched before the deadline.

Validation: `cargo check -p ngit-grasp --tests`; callers are covered by
the relay_identity and sync binaries measured in the following commits.

Assisted-by: Claude Fable 5.1
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 14:23:08 +00:00
..