@@ -139,7 +139,7 @@ class SyncIntegrationTest {
139
139
140
140
database.close()
141
141
turbine.waitFor { ! it.connected }
142
- turbine.cancel ()
142
+ turbine.cancelAndIgnoreRemainingEvents ()
143
143
}
144
144
145
145
// Closing the database should have closed the channel
@@ -159,7 +159,7 @@ class SyncIntegrationTest {
159
159
160
160
database.disconnect()
161
161
turbine.waitFor { ! it.connected }
162
- turbine.cancel ()
162
+ turbine.cancelAndIgnoreRemainingEvents ()
163
163
}
164
164
165
165
// Disconnecting should have closed the channel
@@ -178,7 +178,7 @@ class SyncIntegrationTest {
178
178
turbineScope(timeout = 10.0 .seconds) {
179
179
val turbine = database.currentStatus.asFlow().testIn(this )
180
180
turbine.waitFor { it.connected }
181
- turbine.cancel ()
181
+ turbine.cancelAndIgnoreRemainingEvents ()
182
182
}
183
183
184
184
assertFailsWith<PowerSyncException >(" Cannot update schema while connected" ) {
@@ -276,7 +276,7 @@ class SyncIntegrationTest {
276
276
turbine.waitFor { it.hasSynced == true }
277
277
expectUserCount(4 )
278
278
279
- turbine.cancel ()
279
+ turbine.cancelAndIgnoreRemainingEvents ()
280
280
}
281
281
282
282
syncLines.close()
@@ -349,7 +349,7 @@ class SyncIntegrationTest {
349
349
350
350
syncLines.send(SyncLine .CheckpointComplete (lastOpId = " 1" ))
351
351
turbine.waitFor { ! it.downloading }
352
- turbine.cancel ()
352
+ turbine.cancelAndIgnoreRemainingEvents ()
353
353
}
354
354
355
355
database.close()
@@ -369,7 +369,7 @@ class SyncIntegrationTest {
369
369
database.disconnect()
370
370
371
371
turbine.waitFor { ! it.connecting && ! it.connected }
372
- turbine.cancel ()
372
+ turbine.cancelAndIgnoreRemainingEvents ()
373
373
}
374
374
375
375
database.close()
@@ -414,7 +414,7 @@ class SyncIntegrationTest {
414
414
assertEquals(1 , rows.size)
415
415
}
416
416
417
- turbine.cancel ()
417
+ turbine.cancelAndIgnoreRemainingEvents ()
418
418
}
419
419
420
420
database.close()
@@ -486,8 +486,8 @@ class SyncIntegrationTest {
486
486
db2.disconnect()
487
487
turbine2.waitFor { ! it.connecting }
488
488
489
- turbine1.cancel ()
490
- turbine2.cancel ()
489
+ turbine1.cancelAndIgnoreRemainingEvents ()
490
+ turbine2.cancelAndIgnoreRemainingEvents ()
491
491
}
492
492
493
493
db2.close()
@@ -512,7 +512,7 @@ class SyncIntegrationTest {
512
512
database.disconnect()
513
513
turbine.waitFor { ! it.connecting }
514
514
515
- turbine.cancel ()
515
+ turbine.cancelAndIgnoreRemainingEvents ()
516
516
}
517
517
518
518
database.close()
@@ -531,7 +531,7 @@ class SyncIntegrationTest {
531
531
database.connect(connector, 1000L , retryDelayMs = 5000 )
532
532
turbine.waitFor { it.connecting }
533
533
534
- turbine.cancel ()
534
+ turbine.cancelAndIgnoreRemainingEvents ()
535
535
}
536
536
537
537
database.close()
@@ -580,7 +580,7 @@ class SyncIntegrationTest {
580
580
turbineScope {
581
581
val turbine = database.currentStatus.asFlow().testIn(this )
582
582
turbine.waitFor { it.downloading }
583
- turbine.cancel ()
583
+ turbine.cancelAndIgnoreRemainingEvents ()
584
584
}
585
585
586
586
syncLines.send(
@@ -635,7 +635,7 @@ class SyncIntegrationTest {
635
635
turbineScope {
636
636
val turbine = database.currentStatus.asFlow().testIn(this )
637
637
turbine.waitFor { ! it.downloading }
638
- turbine.cancel ()
638
+ turbine.cancelAndIgnoreRemainingEvents ()
639
639
}
640
640
641
641
// Meaning that the two rows are now visible
0 commit comments