Repository navigation
test(media): observe media overlap without a wall-clock margin - #20
Merged
Merged
Conversation
Three media tests proved concurrent resolution by asserting the elapsed time was below a fraction of the serial sum (for example `2 x 80 ms - 40 ms`, and `2 x 120 ms - 10 ms` on `/v1/responses`). The Windows CI job failed one of them (123 ms against a 120 ms bound) while the identical tree passed on every other job and on the pull request run; a later run failed the `/v1/messages` twin (113 ms against a 110 ms bound). A shared runner can add tens of milliseconds of scheduling latency to a whole request, so a margin of a few dozen milliseconds cannot reliably distinguish overlap from serial resolution. The three fixtures now record the highest number of requests they were answering at once and the paths in arrival order, and the tests assert on that. A serial resolver can never exceed one in-flight request, so the property under test is observed directly instead of inferred from timing, and the tests no longer depend on machine speed. The delays stay, because they are what keeps two overlapping downloads open at the same time. Test-only change; no source behaviour changed.
dinhdev666
force-pushed
the
test/observe-media-overlap-without-wall-clock
branch
from
December 5, 2026 06:26
6fbc551 to
a55bc5d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Three media tests proved concurrent resolution by asserting elapsed time was
below a fraction of the serial sum (
2 x 80 ms - 40 msin the chat suite,2 x 120 ms - 10 mson/v1/responses, and a 110 ms bound on/v1/messages).The Windows CI job failed the chat assertion once (123 ms against a 120 ms
bound) while the identical tree passed on every other job and on the PR run; the
next run failed the
/v1/messagestwin (113 ms against a 110 ms bound). A sharedrunner can add tens of milliseconds of scheduling latency to a whole request, so
a margin of a few dozen milliseconds cannot reliably distinguish overlap from
serial resolution.
The three fixtures now record the highest number of requests they were answering
at once and the paths in arrival order; the tests assert on that. A serial
resolver can never exceed one in-flight request, so the property under test is
observed directly instead of inferred from timing. The delays stay, because they
are what keeps two overlapping downloads open at the same time.
Test-only change; no source behaviour changed.
How it was verified
CI on the branch: Commit messages, Docker image, Verify (Node 20.x), Verify
(Node 22.x) and Verify on Windows (Node 22.x) all pass — the Windows job that
failed twice on the timing assertion is green with the counter-based check.
Checklist
pnpm typecheckpasses.pnpm buildpasses.pnpm testpasses.pnpm lint:commits(Conventional Commits).docs/ARCHITECTURE.mdand the relevant reference doc are updated when acontract, an environment variable or a wire format changed.
(Test-only change.)