diff --git a/android/app/src/test/java/tv/orbit/classic/RoomsTest.kt b/android/app/src/test/java/tv/orbit/classic/RoomsTest.kt index a1a1d716..2bc1ca84 100644 --- a/android/app/src/test/java/tv/orbit/classic/RoomsTest.kt +++ b/android/app/src/test/java/tv/orbit/classic/RoomsTest.kt @@ -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 } }