Skip to content

Commit 44566d5

Browse files
test(core): Allow repeated scopes storage set calls in SentryTest (#6359)
The custom storage mock always returns null from get(), so the BackpressureMonitor health check, scheduled 500ms after init, forks the root scopes and calls set() again. On slow runners that landed before verify and failed the test with TooManyActualInvocations. Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Nelson Osacky <nelson.osacky@sentry.io>
1 parent dbad316 commit 44566d5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎sentry/src/test/java/io/sentry/SentryTest.kt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1879,7 +1879,9 @@ class SentryTest {
18791879
}
18801880

18811881
verify(customStorage).init()
1882-
verify(customStorage).set(any())
1882+
// get() always returns null here, so every later getCurrentScopes() call forks the root scopes
1883+
// and calls set() again, e.g. the BackpressureMonitor health check on the executor
1884+
verify(customStorage, atLeastOnce()).set(any())
18831885
}
18841886

18851887
@Test

0 commit comments

Comments
 (0)