Repository navigation
test: Remove wall-clock and flush timing assumptions from unit tests - #26467
Merged
s1gr1d merged 2 commits intoNov 17, 2026
Merged
Conversation
Contributor
size-limit report 📦Compared: f56bcca (PR test merge using develop at 18fd907) Against: 9b7265f (develop) · base run #66464
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 3 not successful, 60 successful. See the run.
Successful checks
|
s1gr1d
marked this pull request as ready for review
November 17, 2026 12:53
javascript-sdk-gitflow
Bot
requested review from
andreiborza,
isaacs and
nicohrubec
November 17, 2026 12:53
The tests compared a span timestamp with an earlier clock read and allowed a few milliseconds of difference. On a busy CI runner, more real time passed between the two reads (9 ms in two failed runs). `works without endTimestamp` now uses fake timers. The other tests check that the timestamp lies between two clock reads.
The tests read the captured events directly after `server.finished`. The event pipeline awaits file reads for the context lines before it calls `beforeSend`, so an event could still be in flight. This failed 12 CI runs in one month. The tests now wait for `client.flush()`, as the later tests in the file do.
s1gr1d
force-pushed
the
sig/test-unit-clock-and-flush
branch
from
November 17, 2026 13:33
9784897 to
ce1cb68
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
sentrySpan, Effect tracer, andSentryTracerProvidertests do not compare a timestamp with a wall-clock tolerance.Deno.servetests flush the client before they read the captured events.Why
Both groups failed on busy CI runners in the last month, without a defect in the SDK:
SentrySpan > end > works without endTimestampallowed 5 ms between two clock reads; the failed runs measured 9 ms. The test now uses fake timers. The other tests check that the timestamp lies between two clock reads, which does not depend on how fast the runner is. An injected 1 ms error in the span end time still fails the tests.server.finished, but the event pipeline awaits file reads for the context lines beforebeforeSend. This failed 12 runs. The unchanged file also failed locally in 1 of 9 runs; with the flush it passed 14 of 14.Fourth PR of a stack of four.