Point the unreachable-app test at port 1 #52

Merged
clawbot merged 1 commits from issue-51-unreachable-app-test into next 2026-10-04 06:39:09 +02:00
Collaborator

Closes #51.

TestAnswers502WhenTheAppCannotBeReached closed a listener and then pointed smallwebwaf at that port. Another test running at the same time could open the port in between, so the test sometimes got that test's answer (200, 429) instead of a 502.

The test now points smallwebwaf at 127.0.0.1:1, with a one-line comment saying why that port is safe. Nothing listens on port 1, and every test listens on port 0, which the kernel answers with a port from its ephemeral range (32768 to 60999 on Linux, on the host and in the Docker test phase alike). So no test can take port 1, and connecting to it is refused straight away rather than left hanging.

No other test closes a listener and then reuses its port: TestAddressInUseStopsTheStart keeps its listener open on purpose, and the timeout tests close theirs only once they are done. Test-only change; smallwebwaf itself is untouched.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/smallwebwaf/issues/51. `TestAnswers502WhenTheAppCannotBeReached` closed a listener and then pointed `smallwebwaf` at that port. Another test running at the same time could open the port in between, so the test sometimes got that test's answer (`200`, `429`) instead of a `502`. The test now points `smallwebwaf` at `127.0.0.1:1`, with a one-line comment saying why that port is safe. Nothing listens on port 1, and every test listens on port 0, which the kernel answers with a port from its ephemeral range (32768 to 60999 on Linux, on the host and in the Docker test phase alike). So no test can take port 1, and connecting to it is refused straight away rather than left hanging. No other test closes a listener and then reuses its port: `TestAddressInUseStopsTheStart` keeps its listener open on purpose, and the timeout tests close theirs only once they are done. Test-only change; `smallwebwaf` itself is untouched. Model: opus-5-5
clawbot added the needs-review label 2026-10-04 06:23:08 +02:00
clawbot self-assigned this 2026-10-04 06:23:08 +02:00
clawbot added 1 commit 2026-10-04 06:23:09 +02:00
TestAnswers502WhenTheAppCannotBeReached closed a listener and pointed
smallwebwaf at its port, which another test running in parallel could
open in between, so the test sometimes got that server's answer instead
of a 502. It now uses 127.0.0.1:1: nothing listens there, and a test
listening on port 0 is always given a port from 32768 up, so no test
can take it. No other test reuses a closed listener's port.

Model: opus-5-5
Author
Collaborator

Review passed.

Judgement call: the test's comment says no test can listen on port 1; that holds because every test in the repo listens on port 0 and none asks for a fixed port, so it is accepted as written.
Judgement call: "from 32768 up" is the Linux default range, which is where the tests run (the Docker test phase), so it is accepted without naming other systems.

Model: opus-5-5

Review passed. Judgement call: the test's comment says no test can listen on port 1; that holds because every test in the repo listens on port 0 and none asks for a fixed port, so it is accepted as written. Judgement call: "from 32768 up" is the Linux default range, which is where the tests run (the Docker test phase), so it is accepted without naming other systems. Model: opus-5-5
clawbot merged commit d730fcb57d into next 2026-10-04 06:39:09 +02:00
clawbot deleted branch issue-51-unreachable-app-test 2026-10-04 06:39:09 +02:00
clawbot removed the needs-review label 2026-10-04 06:39:09 +02:00
Sign in to join this conversation.