Skip to content

test: wait for the Sentry scrubbers before closing in the log and span scrub tests - #216

Merged
cevheri merged 1 commit into
mainfrom
fix/215-sentry-log-test
Oct 24, 2026
Merged

cevheri merged 1 commit into
mainfrom
fix/215-sentry-log-test

Conversation

@cevheri

@cevheri cevheri commented Oct 24, 2026

Copy link
Copy Markdown
Member

Main CI has been red since 71069cf on the Sentry log scrub test.
Cause: Sentry 10.1.0 adds the device contexts to a log or a streamed span before its scrubber runs, and on Linux that spawns `cat /proc/meminfo`. One `pumpEventQueue()` does not wait for a subprocess, so `Sentry.close` flushed an empty buffer.
The green cd7a1aa and red 71069cf trees are identical, so the flip came from runner timing.

Reproduced first: a `cat` on PATH that sleeps 0.2 s fails the log test and the streamed span test on every run, and 6 busy loops pinned to one CPU fail the log test 1 run in 10.
The tests now wait until the scrubber has returned, then drain the remaining microtasks and close. The assertions are unchanged.
With the fix the file passes with a 2 s `cat`, and 50 runs in a row under load all pass. The full local suite passes (4898 tests).

Closes #215

…umber of event turns

Sentry 10.1.0 adds the device contexts to a log or a streamed span before its scrubber runs, and on Linux that runs cat /proc/meminfo as a subprocess. One pumpEventQueue() does not wait for a subprocess, so under CI load Sentry.close flushed an empty buffer and the log test saw no log item. The tests now wait until the scrubber has returned, then drain the remaining microtasks before closing. The assertions are unchanged.
@cevheri
cevheri merged commit 2d96926 into main Oct 24, 2026
6 checks passed
@cevheri
cevheri deleted the fix/215-sentry-log-test branch October 24, 2026 16:26
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.

Flaky Sentry log scrub test: the log item can miss the transport before Sentry.close()

1 participant