|
1 | 1 | package com.onesignal.core.internal.operations |
2 | 2 |
|
| 3 | +import com.onesignal.common.threading.OSPrimaryCoroutineScope |
3 | 4 | import com.onesignal.common.threading.Waiter |
4 | 5 | import com.onesignal.common.threading.WaiterWithValue |
5 | 6 | import com.onesignal.core.internal.operations.impl.OperationModelStore |
@@ -100,6 +101,7 @@ class OperationRepoTests : FunSpec({ |
100 | 101 | listOf(mocks.executor), |
101 | 102 | operationModelStore, |
102 | 103 | mocks.configModelStore, |
| 104 | + mocks.identityModelStore, |
103 | 105 | Time(), |
104 | 106 | getNewRecordState(mocks.configModelStore), |
105 | 107 | ), |
@@ -165,6 +167,7 @@ class OperationRepoTests : FunSpec({ |
165 | 167 | // When |
166 | 168 | operationRepo.start() |
167 | 169 | operationRepo.enqueue(MyOperation()) |
| 170 | + OSPrimaryCoroutineScope.waitForIdle() |
168 | 171 |
|
169 | 172 | // Then |
170 | 173 | operationRepo.containsInstanceOf<MyOperation>() shouldBe true |
@@ -269,6 +272,7 @@ class OperationRepoTests : FunSpec({ |
269 | 272 | // When |
270 | 273 | opRepo.start() |
271 | 274 | opRepo.enqueue(mockOperation()) |
| 275 | + OSPrimaryCoroutineScope.waitForIdle() |
272 | 276 | val response1 = |
273 | 277 | withTimeoutOrNull(999) { |
274 | 278 | opRepo.enqueueAndWait(mockOperation()) |
@@ -647,6 +651,7 @@ class OperationRepoTests : FunSpec({ |
647 | 651 | mocks.operationRepo.start() |
648 | 652 | mocks.operationRepo.enqueue(operation1) |
649 | 653 | mocks.operationRepo.enqueue(operation2) |
| 654 | + OSPrimaryCoroutineScope.waitForIdle() |
650 | 655 | mocks.operationRepo.enqueueAndWait(operation3) |
651 | 656 |
|
652 | 657 | // Then |
@@ -727,6 +732,7 @@ class OperationRepoTests : FunSpec({ |
727 | 732 | val mocks = Mocks() |
728 | 733 | val op = mockOperation() |
729 | 734 | mocks.operationRepo.enqueue(op) |
| 735 | + OSPrimaryCoroutineScope.waitForIdle() |
730 | 736 |
|
731 | 737 | // When |
732 | 738 | mocks.operationRepo.loadSavedOperations() |
@@ -767,6 +773,7 @@ class OperationRepoTests : FunSpec({ |
767 | 773 | // When |
768 | 774 | opRepo.start() |
769 | 775 | opRepo.enqueue(mockOperation()) |
| 776 | + OSPrimaryCoroutineScope.waitForIdle() |
770 | 777 | val response1 = |
771 | 778 | withTimeoutOrNull(999) { |
772 | 779 | opRepo.enqueueAndWait(mockOperation()) |
|
0 commit comments