Skip to content

test(js): de-flake fingerprint determinism test (pin Span timestamp)#26

Merged
beyhangl merged 1 commit into
mainfrom
fix/flaky-js-fingerprint-test
May 30, 2026
Merged

test(js): de-flake fingerprint determinism test (pin Span timestamp)#26
beyhangl merged 1 commit into
mainfrom
fix/flaky-js-fingerprint-test

Conversation

@beyhangl

Copy link
Copy Markdown
Owner

The JS test models.test.ts > "same spans produce same fingerprint" fails intermittently (seen on Node 18 in CI) because Span.timestamp defaults to Date.now() — two spans created across a millisecond boundary hash differently. Pin an explicit timestamp: 0 so the spans are byte-identical.

Test-only, no SDK behavior change. Verified: models.test.ts passes 3/3 runs; full JS suite 145/145.

Note (separate decision for later): the deeper question of whether the fingerprint should include timestamp at all (it makes every re-record of identical behavior produce a different fingerprint, in both the JS and Python SDKs) is left unchanged here.

…tamp

new Span({...}) defaults timestamp to Date.now(), so the two spans in
"same spans produce same fingerprint" got different timestamps when their
creation straddled a millisecond — making the test (and CI) intermittently
fail (seen on Node 18). Pass an explicit timestamp: 0 so the spans are
byte-identical. Test-only; no SDK behavior change.
@beyhangl beyhangl merged commit 8eb97ae into main May 30, 2026
9 checks passed
@beyhangl beyhangl deleted the fix/flaky-js-fingerprint-test branch May 30, 2026 09:26
beyhangl added a commit that referenced this pull request Jun 1, 2026
…tamp (#26)

new Span({...}) defaults timestamp to Date.now(), so the two spans in
"same spans produce same fingerprint" got different timestamps when their
creation straddled a millisecond — making the test (and CI) intermittently
fail (seen on Node 18). Pass an explicit timestamp: 0 so the spans are
byte-identical. Test-only; no SDK behavior change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant