From 51792f836b7cdbaa64205db287e4663f374769eb Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Tue, 3 Nov 2026 09:08:54 +0000 Subject: [PATCH] test: wait for the repository's active source in artist art tests awaitActiveSourceId() watched the DAO's activeSourceId flow, which turns non-null as soon as the source row is written. SourceRepository sets its in-memory active source in a separate collector, so artistImage() could still see null and the online URL assertion failed. Wait on the repository's own activeSource readiness signal instead. --- .../test/kotlin/com/subtracks/data/repo/SourceRepositoryTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/test/kotlin/com/subtracks/data/repo/SourceRepositoryTest.kt b/app/src/test/kotlin/com/subtracks/data/repo/SourceRepositoryTest.kt index c36e4c60..1ba2508c 100644 --- a/app/src/test/kotlin/com/subtracks/data/repo/SourceRepositoryTest.kt +++ b/app/src/test/kotlin/com/subtracks/data/repo/SourceRepositoryTest.kt @@ -314,7 +314,7 @@ class SourceRepositoryTest { assertNull(repository.artistImage("ar2", "https://img.example/ar2.jpg")) } - private suspend fun awaitActiveSourceId(): Long = withTimeout(TEST_TIMEOUT_MS) { repository.activeSourceId().first { it != null }!! } + private suspend fun awaitActiveSourceId(): Long = withTimeout(TEST_TIMEOUT_MS) { repository.activeSource.first { it != null }!! } private suspend fun awaitCoverArt(coverArt: String): CoverArtRef = withTimeout(TEST_TIMEOUT_MS) {