Skip to content

test(replay): Fix flaky EventBufferCompressionWorker size limit test - #25519

Open
sentry-junior[bot] wants to merge 1 commit into
developfrom
test/replay-flaky-compression-worker-clear
Open

sentry-junior[bot] wants to merge 1 commit into
developfrom
test/replay-flaky-compression-worker-clear

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

The size limit tests in EventBufferCompressionWorker.test.ts build events sized against the real REPLAY_MAX_EVENT_BUFFER_SIZE (~20MB). That pushes 13–20MB of JSON through jsdom-worker and fflate on every test, in the same process. The tests don't hang. They're just CPU-bound, taking 6–11s on a busy CI runner, so they sometimes go over the 10s timeout. "resets size limit on clear" failed twice on develop this way. Under CPU load locally I could reproduce the same Test timed out in 10000ms.

The size check is a plain counter in EventBufferCompressionWorker, so the actual byte count doesn't matter. This mocks REPLAY_MAX_EVENT_BUFFER_SIZE to 100kB for this file, the same approach test/integration/eventBuffer.test.ts already uses. The custom 10s timeout is gone because it's no longer needed. The tests now run in ~15ms each, and they still fail if clear() stops resetting the size counter.

via Francesco Gringl-Novy.

--

View Junior Session [Sentry]

Co-Authored-By: Francesco Gringl-Novy <francesco.novy@sentry.io>
@mydea
mydea marked this pull request as ready for review October 19, 2026 14:09
@mydea
mydea requested a review from a team as a code owner October 19, 2026 14:10
@mydea
mydea requested review from Lms24 and logaretm and removed request for a team October 19, 2026 14:10
@mydea mydea self-assigned this Oct 19, 2026

This branch has not been deployed

No deployments
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