Files
airship/packages
Nayan 1392c3b461 test(server): wait for the reply, not for the clock
The windows leg failed on `admits a same-origin page` — `expected false to
be true` against `reply.startsWith("HTTP/1.1 101 ")`. Not the Origin gate:
`originMatchesHost` is URL parsing and cannot differ by platform. The
reply simply had not arrived yet.

Every case here read until a fixed 600ms `HOLD_OPEN_MS` elapsed, because a
completed upgrade never closes and something has to end the read. That is
right for a refusal, where the silence *is* the assertion — but for a case
asserting that something arrives it is a race, and on the windows runner
all four of those sat at 603-628ms against the 600ms budget. One of them
lost by 28ms. The others passed by three.

What costs the time is `git:health`, written beside `hello`: it spawns git
against a cwd that is deliberately not a repository, and two process
spawns on a cold Windows runner do not fit in a few hundred milliseconds.

So `exchange` takes an optional `until` and stops the moment the awaited
bytes are in. The ceiling for those is 10s and is only ever reached when
the server is genuinely broken, so it can be generous without costing
anything; `HOLD_OPEN_MS` stays exactly as it was for the refusals, which
still need a quiet window rather than an early return — returning early
there would make "and nothing followed" vacuous.

The refusals never actually paid it: the server closes a refused socket,
so they resolve on `close`. The six that paid it were the four
101/hello cases and the two 200s, none of which close on their own, and
all six now name what they are waiting for. Package test time drops from
4.2s to 128ms as a side effect.
2026-08-16 13:05:37 +05:30
..