Skip to content

Commit 7c81e67

Browse files
authored
fixed executor test (#4881)
1 parent 875286a commit 7c81e67

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sentry/src/test/java/io/sentry/SentryExecutorServiceTest.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,11 @@ class SentryExecutorServiceTest {
225225
future.cancel(true)
226226
}
227227
assertEquals(1000, executor.queue.size)
228+
228229
// Submit should purge cancelled scheduled jobs
229230
sentryExecutor.submit {}
230-
assertEquals(1, executor.queue.size)
231+
// The queue size should be 1, but if the executor thread runs right before we check the size,
232+
// it returns 0
233+
assertTrue(executor.queue.size < 2)
231234
}
232235
}

0 commit comments

Comments
 (0)