Skip to content

Commit 0a4b1cd

Browse files
committed
Wait for isClosedForSend
1 parent a886231 commit 0a4b1cd

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

core/src/commonIntegrationTest/kotlin/com/powersync/SyncIntegrationTest.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import com.powersync.testutils.databaseTest
1515
import com.powersync.testutils.waitFor
1616
import com.powersync.utils.JsonUtil
1717
import dev.mokkery.verify
18-
import io.kotest.assertions.withClue
1918
import io.kotest.matchers.collections.shouldHaveSize
2019
import io.kotest.matchers.shouldBe
2120
import kotlinx.coroutines.DelicateCoroutinesApi
@@ -48,10 +47,8 @@ class SyncIntegrationTest {
4847
turbine.cancel()
4948
}
5049

51-
// Closing the database should have closed the channel
52-
withClue("Should have closed sync stream") {
53-
syncLines.isClosedForSend shouldBe true
54-
}
50+
// Closing the database should have closed the channel.
51+
waitFor { syncLines.isClosedForSend shouldBe true }
5552
}
5653

5754
@Test
@@ -71,9 +68,7 @@ class SyncIntegrationTest {
7168
}
7269

7370
// Disconnecting should have closed the channel
74-
withClue("Should have closed sync stream") {
75-
syncLines.isClosedForSend shouldBe true
76-
}
71+
waitFor { syncLines.isClosedForSend shouldBe true }
7772

7873
// And called invalidateCredentials on the connector
7974
verify { connector.invalidateCredentials() }

0 commit comments

Comments
 (0)