Rooms test: give the link's close a moment in the full suite (it failed now and then)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-07 09:03:02 +00:00
co-authored by Claude Opus 5.5
parent 1e0cd4cdb4
commit 4606a29d5e
@@ -77,7 +77,8 @@ class RoomsTest {
assertEquals(1, join.collect().getOrThrow()!!.getInt("version"))
PhoneLink.offerRoom(null)
// With no offer and no phones, the server stops altogether.
assertTrue(runCatching { call("POST", "/room/hello", "{}") }.isFailure)
// The close can take a moment to land when the full suite runs (it failed now and then): give it up to a second.
assertTrue((1..20).any { runCatching { call("POST", "/room/hello", "{}") }.isFailure.also { stopped -> if (!stopped) Thread.sleep(50) } })
} finally { PhoneLink.stop(); PhoneLink.allowed = EmbyServer::isHomeAddress; PhoneLink.bindTo = null; PhoneLink.port = PhoneLink.PORT }
}