mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
address review: join the controller scope, keep DB closes where nothing leaks
PlaybackController.now exposes awaitStopped() so the tests that own its DB can join its scope before db.close(); close() stays cancel-only so AppModuleTest (Main dispatcher) cannot deadlock. Restores db.close() in the tests that have no leaking scope, closes the SyncManager AddSourceViewModelTest was leaking, replaces the duplicated poll with the existing awaitCoverArt helper, and trims the testLogging block to the one line that does anything.
This commit is contained in:
@@ -173,6 +173,10 @@ class PlaybackController(
|
||||
scope.cancel()
|
||||
}
|
||||
|
||||
internal suspend fun awaitStopped() {
|
||||
scope.coroutineContext[Job]?.join()
|
||||
}
|
||||
|
||||
private val _ready = MutableStateFlow(false)
|
||||
val ready: StateFlow<Boolean> = _ready
|
||||
|
||||
|
||||
Reference in New Issue
Block a user