e2e: a test node can be given the same port for its pool and its API #719

Closed
opened 2026-10-24 23:55:24 +00:00 by excho0 · 1 comment
Owner

What happened

The desktop job on #717 failed in node overview streams the joined pool without exposing worker counts to worker-only nodes (job). #717's change doesn't touch this test:

Error: the node stopped before answering on its local API (coordinator rig on 127.0.0.1:44969, exited with 1)
level=INFO msg="coordinator listening" addr=127.0.0.1:44969 name=rig
sisyphusd: listen tcp 127.0.0.1:44969: bind: address already in use

Cause

The node's pool address and its API address were the same port, 44969. testNode picks them with two freePort() calls in a row (apps/sisyphus/e2e/harness.ts). Each call listens on port 0, reads the port and closes the listener again. The second call can therefore be given the port the first one just released. Then the daemon's second listen fails. launchOwnNode picks its api and web ports the same way.

Fix

Add a freePorts(n) that keeps every listener open until all n ports are known, so the ports always differ, and use it in both places.

## What happened The `desktop` job on #717 failed in `node overview streams the joined pool without exposing worker counts to worker-only nodes` ([job](https://github.com/sisyphus-network/Sisyphus/actions/runs/40143407202/job/121019744356)). #717's change doesn't touch this test: ``` Error: the node stopped before answering on its local API (coordinator rig on 127.0.0.1:44969, exited with 1) level=INFO msg="coordinator listening" addr=127.0.0.1:44969 name=rig sisyphusd: listen tcp 127.0.0.1:44969: bind: address already in use ``` ## Cause The node's pool address and its API address were the same port, 44969. `testNode` picks them with two `freePort()` calls in a row (`apps/sisyphus/e2e/harness.ts`). Each call listens on port 0, reads the port and closes the listener again. The second call can therefore be given the port the first one just released. Then the daemon's second listen fails. `launchOwnNode` picks its `api` and `web` ports the same way. ## Fix Add a `freePorts(n)` that keeps every listener open until all n ports are known, so the ports always differ, and use it in both places.
Author
Owner

Taking this: a small PR adding freePorts(n) to the e2e harness, with a unit test that the ports it gives are distinct.

Taking this: a small PR adding `freePorts(n)` to the e2e harness, with a unit test that the ports it gives are distinct.
Sign in to join this conversation.
No labels area:ci bug
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Sisyphus/Sisyphus#719