waf: wait as long as it takes for a test request's answer (closes #454) #468

Open
clawbot wants to merge 1 commits from issue-454-crs-test-load-timeout into next
pull from: issue-454-crs-test-load-timeout
Collaborator

Closes #454

The test helpers in internal/waf waited 10 seconds for things a busy host can delay:

  • requestWithBody gave the answer a 10-second read deadline;
  • endedLines gave the request's last log line 10 seconds.

Under the race detector, the Core Rule Set's inspection of a request with 1000 query parameters ran past that at a load average of about 280. Both helpers now wait until the answer or line comes. A test whose answer never comes is ended by go test's -timeout (90 seconds in the Dockerfile), whose panic names the test and dumps the goroutines.

A timeout was always fatal in both helpers, so no passing test depended on either wait; a test that would have failed after 10 seconds now fails at the package timeout instead.

Judgement call: endedLines is changed too, though the failure was in the read, since the log-line wait is on the same request's path and a load-only timeout there would fail the issue's definition of done. The other uses of waitLimit are untouched.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/smallwebwaf/issues/454 The test helpers in `internal/waf` waited 10 seconds for things a busy host can delay: - `requestWithBody` gave the answer a 10-second read deadline; - `endedLines` gave the request's last log line 10 seconds. Under the race detector, the Core Rule Set's inspection of a request with 1000 query parameters ran past that at a load average of about 280. Both helpers now wait until the answer or line comes. A test whose answer never comes is ended by `go test`'s `-timeout` (90 seconds in the `Dockerfile`), whose panic names the test and dumps the goroutines. A timeout was always fatal in both helpers, so no passing test depended on either wait; a test that would have failed after 10 seconds now fails at the package timeout instead. Judgement call: `endedLines` is changed too, though the failure was in the read, since the log-line wait is on the same request's path and a load-only timeout there would fail the issue's definition of done. The other uses of `waitLimit` are untouched. Model: opus-5-5
clawbot self-assigned this 2026-11-19 18:44:04 +01:00
clawbot added 1 commit 2026-11-19 18:44:04 +01:00
requestWithBody gave the answer 10 seconds, and endedLines gave the log
line 10 seconds. On a busy host the Core Rule Set's inspection of a
request with 1000 query parameters, under the race detector, took
longer. Both now wait until the answer or line comes; go test's
-timeout ends a test where it never does.

Model: opus-5-5
clawbot added the needs-review label 2026-11-19 18:44:11 +01:00
Author
Collaborator

Verdict: PASS
Head: 78b4ef1210

Removing the 10-second waits from requestWithBody and endedLines meets the definition of done of #454 on current next, with nothing beyond it.

Model: opus-5-5

Verdict: PASS Head: 78b4ef1210883156146123f9330d5177ceacf818 Removing the 10-second waits from `requestWithBody` and `endedLines` meets the definition of done of https://git.eeqj.de/sneak/smallwebwaf/issues/454 on current `next`, with nothing beyond it. Model: opus-5-5
Some checks are pending
check / check (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-454-crs-test-load-timeout:issue-454-crs-test-load-timeout
git checkout issue-454-crs-test-load-timeout
Sign in to join this conversation.