From cba942a64fc8fdd278fbdbe9e9da78b42c4530a0 Mon Sep 17 00:00:00 2001 From: Paul Hitt Date: Fri, 9 Oct 2026 06:48:45 -0400 Subject: [PATCH] Answer every request in the lost-send test, not a fixed four The server-error case queued four 503 responses. MockWebServer's queue blocks a request that arrives after the queue is empty, so a send making one request more than expected waits on the read timeout instead of failing. The unit-tests job on MR 160 sat in :app:testReleaseUnitTest for 29 minutes and was killed at the 30-minute limit; this is the one test on the branch with a fixed-length queue. A dispatcher now answers 503 to every request. The CI command, run locally with --rerun-tasks: app 711, engine 723, client 480 (30 live skipped), obfs4 75, 0 failures, 2m 3s. Co-Authored-By: Claude Opus 5.5 --- .../messenger/app/ASendTheRelayNeverSawIsKeptTest.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/test/kotlin/io/flamenet/messenger/app/ASendTheRelayNeverSawIsKeptTest.kt b/app/src/test/kotlin/io/flamenet/messenger/app/ASendTheRelayNeverSawIsKeptTest.kt index 7ebe590..51c0513 100644 --- a/app/src/test/kotlin/io/flamenet/messenger/app/ASendTheRelayNeverSawIsKeptTest.kt +++ b/app/src/test/kotlin/io/flamenet/messenger/app/ASendTheRelayNeverSawIsKeptTest.kt @@ -99,7 +99,12 @@ class ASendTheRelayNeverSawIsKeptTest { @Test fun `a relay that answers with a server error`() { val session = session() - repeat(4) { server.enqueue(MockResponse().setResponseCode(503)) } + // Every request, however many the send makes. A queue of a fixed + // number would block the client on the first request past its end. + server.dispatcher = + object : okhttp3.mockwebserver.Dispatcher() { + override fun dispatch(request: okhttp3.mockwebserver.RecordedRequest) = MockResponse().setResponseCode(503) + } runCatching { session.send(peer, "try again later") }