mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 03:38:23 +00:00
test: harden DesktopBlossomServerListTest against the IO-dispatcher race
The compose-ui-test job failed once on this test (green locally and on every re-run): BlossomServerListState's flow is stateIn over Dispatchers.IO, so asserting the synchronous getter before the flow had settled raced the IO hop on fast runners. Await the flow first - it settling proves the state finished wiring - then assert the getter. This PR does not otherwise touch nipB7Blossom; the test predates it (#3918). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011S1vbFWVVAMFDT8PTgdibV
This commit is contained in:
+4
-1
@@ -93,7 +93,10 @@ class DesktopBlossomServerListTest {
|
||||
scope = backgroundScope,
|
||||
)
|
||||
|
||||
assertEquals(servers, state.getBlossomServersList()?.servers())
|
||||
// Await the IO-backed stateIn subscription first: the flow settling proves the
|
||||
// state finished wiring, after which the synchronous getter must agree. Asserting
|
||||
// the getter before the flow raced the Dispatchers.IO hop on fast CI runners.
|
||||
assertEquals(servers, state.flow.first { it.isNotEmpty() })
|
||||
assertEquals(servers, state.getBlossomServersList()?.servers())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user