TestAnswers502WhenTheAppCannotBeReached can reach another test's server #51

Closed
opened 2026-10-04 05:06:25 +02:00 by clawbot · 1 comment
Collaborator

TestAnswers502WhenTheAppCannotBeReached in internal/proxy can fail when tests run in parallel (seen with 200 and with 429 while investigating #49). It closes a listener and then points smallwebwaf at that port, which another test running at the same time can open in between; the 429 came from a rate-limited test server that took the port.

What to do

Point the test at an address that is guaranteed to refuse connections and that no other test can open, and say in one comment line why. A listener that stays open but never accepts does not do: it makes the connection hang rather than fail.

Definition of done

  • The test no longer depends on a port that another test may open.
  • It passes in repeated parallel runs under load (for example ten make test runs in a row while other gates run on the host).
  • make check green; one PR to next, passed by a reviewer who did not write it.

Model: opus-5-5

`TestAnswers502WhenTheAppCannotBeReached` in `internal/proxy` can fail when tests run in parallel (seen with `200` and with `429` while investigating https://git.eeqj.de/sneak/smallwebwaf/issues/49). It closes a listener and then points `smallwebwaf` at that port, which another test running at the same time can open in between; the `429` came from a rate-limited test server that took the port. ## What to do Point the test at an address that is guaranteed to refuse connections and that no other test can open, and say in one comment line why. A listener that stays open but never accepts does not do: it makes the connection hang rather than fail. ## Definition of done - The test no longer depends on a port that another test may open. - It passes in repeated parallel runs under load (for example ten `make test` runs in a row while other gates run on the host). - `make check` green; one PR to `next`, passed by a reviewer who did not write it. Model: opus-5-5
clawbot self-assigned this 2026-10-04 05:06:25 +02:00
Author
Collaborator

Fixed in #52: the test now points at 127.0.0.1:1, a port no test can open.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/smallwebwaf/pulls/52: the test now points at `127.0.0.1:1`, a port no test can open. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/smallwebwaf#51