Skip to content

Commit 99334e8

Browse files
nan-liclaude
andcommitted
Use waitForInternalEnqueue helper in dedupe test
Replace the ad-hoc runBlocking { delay(100) } in the new LoginUserOperation dedupe test with the same waitForInternalEnqueue helper every other test in the file uses. Deterministic instead of a fixed 100ms race against CI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5127988 commit 99334e8

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

OneSignalSDK/onesignal/core/src/test/java/com/onesignal/core/internal/operations/OperationRepoTests.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ class OperationRepoTests : FunSpec({
161161

162162
// When — enqueue the incoming op (simulates enqueueLogin landing after recovery)
163163
operationRepo.enqueue(incomingOp)
164-
165-
// Yield so the launched coroutine in enqueue() can run
166-
kotlinx.coroutines.runBlocking { delay(100) }
164+
mocks.waitForInternalEnqueue()
167165

168166
// Then — queue has only the original op, with merged existingOnesignalId
169167
operationRepo.queue.size shouldBe 1

0 commit comments

Comments
 (0)