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
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
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 next2026-10-04 06:39:09 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #51.
TestAnswers502WhenTheAppCannotBeReachedclosed a listener and then pointedsmallwebwafat 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 a502.The test now points
smallwebwafat127.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:
TestAddressInUseStopsTheStartkeeps its listener open on purpose, and the timeout tests close theirs only once they are done. Test-only change;smallwebwafitself is untouched.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