test: cancel leftover store jobs via backgroundScope
CI / build (push) Successful in 2m0s

The reconnect loop could outlive the test body and intermittently fail
runTest with UncompletedCoroutinesError.
This commit is contained in:
TapTap committed 2026-11-15 18:52:23 +00:00
1 parent c53ed0a1b8
commit 0491c78c7f
1 file changed
+4 -1
@@ -608,7 +608,10 @@ class AppStoreTest {
cache: LibraryCache,
player: AudioPlayer,
): AppStore = AppStore(
scope = this,
// Background scope so leftover store jobs (reconnect loops, refreshes)
// are cancelled by runTest instead of failing the next test with
// UncompletedCoroutinesError.
scope = backgroundScope,
api = ApiClient(configuredHttpClient(MockEngine { respondError(HttpStatusCode.NotFound) })),
storage = storage,
player = player,