Proxy timing tests can fail when the test process is held up for 300 ms #53

Open
opened 2026-10-04 06:43:53 +02:00 by clawbot · 1 comment
Collaborator

make check on next failed once more under heavy host load, on two timing tests in internal/proxy, and passed when the same tests ran again seconds later:

  • TestUpgradedConnectionOutlastsTheTimeouts: "read the answer to the upgrade: unexpected EOF". All four timeouts are 300 ms; if the test process is held up for 300 ms before the upgrade is answered, the timeout rightly runs out before the upgrade, and the test fails although smallwebwaf did what SPEC.md asks.
  • TestRequestTimeouts, case "upstream request timeout, waiting on the app": 408 where it wants 504. This is the reverse of #49: if the client is held up before the app's buffers fill, smallwebwaf is still waiting on the client when the timeout runs out, and 408 is the right answer.

The tests run with a 300 ms timeout on a host where the test process is sometimes held up longer than that. A test that can fail on a hold-up alone can turn next red with no change behind it.

What to do

Go through every test in internal/proxy that uses shortTimeout and make each one unable to fail on a hold-up of the test process alone, without weakening what it checks:

  • where SPEC.md names the right answer for what actually happened, the test expects that answer, as #50 did for the "waiting on the client" cases;
  • where a hold-up can only land in a step that sets up the case rather than in the behaviour under test (for example the upgrade itself, before the timeouts the test is about), make that step unable to run into the timeout.

Each test must still fail if smallwebwaf gets its rule wrong.

Definition of done

  • Every test in internal/proxy that uses shortTimeout is checked; the PR body lists any that needed no change, with one line on why.
  • The tests pass in repeated 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

`make check` on `next` failed once more under heavy host load, on two timing tests in `internal/proxy`, and passed when the same tests ran again seconds later: - `TestUpgradedConnectionOutlastsTheTimeouts`: "read the answer to the upgrade: unexpected EOF". All four timeouts are 300 ms; if the test process is held up for 300 ms before the upgrade is answered, the timeout rightly runs out before the upgrade, and the test fails although `smallwebwaf` did what `SPEC.md` asks. - `TestRequestTimeouts`, case "upstream request timeout, waiting on the app": `408` where it wants `504`. This is the reverse of https://git.eeqj.de/sneak/smallwebwaf/issues/49: if the client is held up before the app's buffers fill, `smallwebwaf` is still waiting on the client when the timeout runs out, and `408` is the right answer. The tests run with a 300 ms timeout on a host where the test process is sometimes held up longer than that. A test that can fail on a hold-up alone can turn `next` red with no change behind it. ## What to do Go through every test in `internal/proxy` that uses `shortTimeout` and make each one unable to fail on a hold-up of the test process alone, without weakening what it checks: - where `SPEC.md` names the right answer for what actually happened, the test expects that answer, as https://git.eeqj.de/sneak/smallwebwaf/pulls/50 did for the "waiting on the client" cases; - where a hold-up can only land in a step that sets up the case rather than in the behaviour under test (for example the upgrade itself, before the timeouts the test is about), make that step unable to run into the timeout. Each test must still fail if `smallwebwaf` gets its rule wrong. ## Definition of done - Every test in `internal/proxy` that uses `shortTimeout` is checked; the PR body lists any that needed no change, with one line on why. - The tests pass in repeated 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 added the critical label 2026-10-04 06:43:53 +02:00
clawbot self-assigned this 2026-10-04 06:43:53 +02:00
Author
Collaborator

#55: the proxy timing tests now use a 5 s timeout that a hold-up of the test process cannot run out before the case is set up; the reading for each test is in the PR body.

Model: opus-5-5

https://git.eeqj.de/sneak/smallwebwaf/pulls/55: the proxy timing tests now use a 5 s timeout that a hold-up of the test process cannot run out before the case is set up; the reading for each test is in the PR body. 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#53