From 5a48670b6570cfea9044c6b19860be9cf3b9bc7f Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Tue, 1 Sep 2026 22:59:46 +0000 Subject: [PATCH] fix(test): daemon 503 test binds an OS-assigned port, not old-port+1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit windows-free-tests flaked on this PR: the tunnel-less restart bound daemon.loopbackPort + 1 — a fixed neighbor of the OS-assigned ephemeral port — and died with 'Is port 55738 in use?' whenever another shard or a TIME_WAIT socket held it; the file-level retry re-rolled the same dice. Every other startDaemon in the file already uses loopbackPort: 0 and the assertion reads d2.loopbackPort, so nothing needs a predictable number. 21/21 pass locally. Co-Authored-By: Claude Fable 5 --- ios-qa/daemon/test/daemon-integration.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ios-qa/daemon/test/daemon-integration.test.ts b/ios-qa/daemon/test/daemon-integration.test.ts index 9073b18d4..8e273d039 100644 --- a/ios-qa/daemon/test/daemon-integration.test.ts +++ b/ios-qa/daemon/test/daemon-integration.test.ts @@ -466,7 +466,12 @@ describe('daemon — loopback listener', () => { await daemon.close(); pidPath = join(workDir, 'daemon-2.pid'); const d2 = await startDaemon({ - loopbackPort: daemon.loopbackPort + 1, + // OS-assigned like every other start in this file — the old + // `daemon.loopbackPort + 1` bound a fixed neighbor port and flaked + // whenever another shard/TIME_WAIT socket held it (windows-free-tests: + // "Is port 55738 in use?"). The fetch below reads d2.loopbackPort, so + // nothing needs a predictable number. + loopbackPort: 0, tailnetEnabled: false, pidfilePath: pidPath, tunnelProvider: async () => null,