From d07f067cd28f5047d4ffa6a33780eff1ee8e5565 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2026 17:05:17 +0000 Subject: [PATCH] test(core): Allow repeated scopes storage set calls in SentryTest 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: Nelson Osacky --- sentry/src/test/java/io/sentry/SentryTest.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sentry/src/test/java/io/sentry/SentryTest.kt b/sentry/src/test/java/io/sentry/SentryTest.kt index 72400f3e33..8888d81c39 100644 --- a/sentry/src/test/java/io/sentry/SentryTest.kt +++ b/sentry/src/test/java/io/sentry/SentryTest.kt @@ -1879,7 +1879,9 @@ class SentryTest { } verify(customStorage).init() - verify(customStorage).set(any()) + // get() always returns null here, so every later getCurrentScopes() call forks the root scopes + // and calls set() again, e.g. the BackpressureMonitor health check on the executor + verify(customStorage, atLeastOnce()).set(any()) } @Test