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:
Claude
2026-08-31 22:36:58 +00:00
parent a9fc0184d4
commit 2cbb39f113
@@ -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())
}
}