Keep the sww and rproxy tests from failing on a busy host (closes #420) #423

Merged
clawbot merged 1 commits from issue-420-tests-under-load into next 2026-11-19 11:43:02 +01:00
Collaborator

Closes #420.

Two time limits in the program were exceeded on a loaded host. next already lifts both for the sww tests that start waf through run and rproxy through startRProxy; that came from the earlier report of these failures, #418. This PR covers the rest:

  • rproxy waits 2 seconds for waf by default. Past that, it drops a report ("no report") or decides a question without waf. The internal/rproxy test helper and the internal/sww startRProxyProcess now set SWW_RPROXY_WAF_BACKEND_TIMEOUT_MS to a minute. A test that sets it keeps its own value, so the timeout tests (200 ms, 3 s, 5 s) are unchanged.
  • waf gives its checks that run beside the lookup 500 ms, then answers 503. TestMainRunsWAF starts waf through Main, which keeps that limit, so the test turns the Core Rule Set off. It checks no Core Rule Set verdict.

No assertion changed.

  • Judgement call: waf's 2-second limit for sending the last lines to SWW_WAF_LOG_REMOTE_URL at shutdown stays. It is product behaviour that sww_internal_test.go pins, and that test's failure in the issue fits a 503 from the first request.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/smallwebwaf/issues/420. Two time limits in the program were exceeded on a loaded host. `next` already lifts both for the `sww` tests that start waf through `run` and rproxy through `startRProxy`; that came from the earlier report of these failures, https://git.eeqj.de/sneak/smallwebwaf/issues/418. This PR covers the rest: - rproxy waits 2 seconds for waf by default. Past that, it drops a report ("no report") or decides a question without waf. The `internal/rproxy` test helper and the `internal/sww` `startRProxyProcess` now set `SWW_RPROXY_WAF_BACKEND_TIMEOUT_MS` to a minute. A test that sets it keeps its own value, so the timeout tests (200 ms, 3 s, 5 s) are unchanged. - waf gives its checks that run beside the lookup 500 ms, then answers 503. `TestMainRunsWAF` starts waf through `Main`, which keeps that limit, so the test turns the Core Rule Set off. It checks no Core Rule Set verdict. No assertion changed. - Judgement call: waf's 2-second limit for sending the last lines to `SWW_WAF_LOG_REMOTE_URL` at shutdown stays. It is product behaviour that `sww_internal_test.go` pins, and that test's failure in the issue fits a 503 from the first request. Model: opus-5-5
clawbot added the needs-review label 2026-11-19 09:48:25 +01:00
clawbot self-assigned this 2026-11-19 09:48:28 +01:00
Author
Collaborator

Verdict: FAIL
Head: 969f472482

  1. internal/sww/rproxy_test.go, startRProxyProcess: rproxy started in a process of its own still waits only the 2-second default for waf, so on a busy host TestRProxyAsksAWAFThatSpeaksHTTP2OverHTTP1 gets the app's 200 instead of waf's 403. Acceptable: the helper sets SWW_RPROXY_WAF_BACKEND_TIMEOUT_MS to a minute unless a test sets it, as startRProxy does.
  2. internal/sww/waf_test.go, TestMainRunsWAF: it starts waf in a process of its own, past run, so the Core Rule Set stays in block mode and the test's one question can get 503 on a busy host. Acceptable: SWW_WAF_CORE_RULE_SET_MODE=off in its environment.
  • Deviation: both findings are already fixed on the branch; the verdict is posted because my brief requires one.

Model: opus-5-5

Verdict: FAIL Head: 969f4724820533548738763b7f533f82c15eff7d 1. `internal/sww/rproxy_test.go`, `startRProxyProcess`: rproxy started in a process of its own still waits only the 2-second default for waf, so on a busy host `TestRProxyAsksAWAFThatSpeaksHTTP2OverHTTP1` gets the app's 200 instead of waf's 403. Acceptable: the helper sets `SWW_RPROXY_WAF_BACKEND_TIMEOUT_MS` to a minute unless a test sets it, as `startRProxy` does. 2. `internal/sww/waf_test.go`, `TestMainRunsWAF`: it starts waf in a process of its own, past `run`, so the Core Rule Set stays in block mode and the test's one question can get 503 on a busy host. Acceptable: `SWW_WAF_CORE_RULE_SET_MODE=off` in its environment. - Deviation: both findings are already fixed on the branch; the verdict is posted because my brief requires one. Model: opus-5-5
Author
Collaborator

Verdict: PASS
Head: 7e16fcd28b

The rproxy and sww tests now wait a minute for waf's answers and run waf without the Core Rule Set, which no sww test checks, so a busy host no longer fails them and no assertion is weakened.

Model: opus-5-5

Verdict: PASS Head: 7e16fcd28b57c1614fcc7d4433441b5fb6f822f7 The rproxy and sww tests now wait a minute for waf's answers and run waf without the Core Rule Set, which no sww test checks, so a busy host no longer fails them and no assertion is weakened. Model: opus-5-5
clawbot added the needs-rebase label 2026-11-19 10:50:30 +01:00
clawbot removed the needs-rebase label 2026-11-19 10:53:11 +01:00
clawbot added 1 commit 2026-11-19 10:58:31 +01:00
The rproxy package's tests and sww's startRProxyProcess give rproxy a
minute for waf's answers unless a test sets
SWW_RPROXY_WAF_BACKEND_TIMEOUT_MS. At the 2-second default, a slow host
made rproxy drop questions and reports.

TestMainRunsWAF runs waf with the Core Rule Set off. Main keeps waf's
500 ms limit for its checks, and under the race detector the Core Rule
Set's inspection could pass it and get 503.

Model: opus-5-5
clawbot force-pushed issue-420-tests-under-load from 7e16fcd28b to 3497c41185 2026-11-19 10:58:31 +01:00 Compare
Author
Collaborator

Rebased onto next as one commit.

  • Finding 1: still fixed in startRProxyProcess.
  • Finding 2: still fixed; the comment in TestMainRunsWAF now gives the reason itself, since run no longer does.
  • Judgement call: next's fix for the earlier report of these failures (#418) already gives run's waf an hour for its checks. I dropped this PR's Core Rule Set switch in run and the block-mode line it needed, so the sww tests run the Core Rule Set again. Reversing it means restoring those two changes.
  • PR body updated to match.

Model: opus-5-5

Rebased onto `next` as one commit. - Finding 1: still fixed in `startRProxyProcess`. - Finding 2: still fixed; the comment in `TestMainRunsWAF` now gives the reason itself, since `run` no longer does. - Judgement call: `next`'s fix for the earlier report of these failures (https://git.eeqj.de/sneak/smallwebwaf/issues/418) already gives `run`'s waf an hour for its checks. I dropped this PR's Core Rule Set switch in `run` and the block-mode line it needed, so the `sww` tests run the Core Rule Set again. Reversing it means restoring those two changes. - PR body updated to match. Model: opus-5-5
Author
Collaborator

Verdict: PASS
Head: 3497c41185

With next's earlier fix, rproxy now waits a minute for waf in the internal/rproxy tests and in startRProxyProcess, and TestMainRunsWAF runs waf without the Core Rule Set, so every test the issue lists is covered and no assertion changes.

Model: opus-5-5

Verdict: PASS Head: 3497c41185d1396e41f98e61aede7de548673a18 With `next`'s earlier fix, rproxy now waits a minute for waf in the `internal/rproxy` tests and in `startRProxyProcess`, and `TestMainRunsWAF` runs waf without the Core Rule Set, so every test the issue lists is covered and no assertion changes. Model: opus-5-5
clawbot merged commit 5099448f79 into next 2026-11-19 11:43:02 +01:00
Sign in to join this conversation.