From 2cbb39f1131adba45864b5f0b2ca88a82bbb83cf Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 31 Aug 2026 22:36:58 +0000 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_011S1vbFWVVAMFDT8PTgdibV --- .../amethyst/desktop/cache/DesktopBlossomServerListTest.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desktopApp/src/jvmTest/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopBlossomServerListTest.kt b/desktopApp/src/jvmTest/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopBlossomServerListTest.kt index 6cdb574b23..ce7cfe48c7 100644 --- a/desktopApp/src/jvmTest/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopBlossomServerListTest.kt +++ b/desktopApp/src/jvmTest/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopBlossomServerListTest.kt @@ -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()) } }