internal/sww tests fail with 503 when the host is under load #418

Closed
opened 2026-11-19 09:18:32 +01:00 by clawbot · 1 comment
Collaborator

make check on next (commit dadd576) failed once in internal/sww while the host was busy (load average about 230 on 48 cores). Run again without any change, it passed.

Tests that failed, all expecting 200 and getting 503 or a refusal:

  • TestBanAddedAndLiftedByEditingBansJSON
  • TestABanThroughOneSiteRefusesTheClientOnTheOther
  • TestWAFKeepsItsBansAcrossARestartAndNeedsNoApp
  • TestStateKeptAcrossRestarts
  • TestAChunkedBodyStaysABodyAtWAF
  • in the -v rerun: TestStalledRemoteLogEndpointHoldsUpNoRequest, TestAStatusWAFDoesNotTakeIsReportedAs599, TestTheSiteAnswersWhileWAFIsStoppedAndStartedAgain

The 503 looks like rproxy getting no answer from waf within SWW_RPROXY_WAF_BACKEND_TIMEOUT_MS when the machine is slow.

Definition of done: these tests pass under heavy host load without longer fixed sleeps. They wait for the condition they check, or give waf a timeout that does not depend on scheduling.

Model: opus-5-5

`make check` on `next` (commit `dadd576`) failed once in `internal/sww` while the host was busy (load average about 230 on 48 cores). Run again without any change, it passed. Tests that failed, all expecting `200` and getting `503` or a refusal: - `TestBanAddedAndLiftedByEditingBansJSON` - `TestABanThroughOneSiteRefusesTheClientOnTheOther` - `TestWAFKeepsItsBansAcrossARestartAndNeedsNoApp` - `TestStateKeptAcrossRestarts` - `TestAChunkedBodyStaysABodyAtWAF` - in the `-v` rerun: `TestStalledRemoteLogEndpointHoldsUpNoRequest`, `TestAStatusWAFDoesNotTakeIsReportedAs599`, `TestTheSiteAnswersWhileWAFIsStoppedAndStartedAgain` The `503` looks like `rproxy` getting no answer from `waf` within `SWW_RPROXY_WAF_BACKEND_TIMEOUT_MS` when the machine is slow. Definition of done: these tests pass under heavy host load without longer fixed sleeps. They wait for the condition they check, or give `waf` a timeout that does not depend on scheduling. Model: opus-5-5
Author
Collaborator

PR: #422, branch issue-418-test-time-limits.

Most of the 503s were waf's own 500 ms limit on the trap paths, rule files and Core Rule Set (checks_timed_out). waf's tests already lifted it; the sww tests could not. waf.Params and sww.Params now take BesideLookupTimeLimit (zero keeps 500 ms). The sww tests give waf an hour and give rproxy a 60 s SWW_RPROXY_WAF_BACKEND_TIMEOUT_MS.

Not covered: TestMainRunsWAF runs waf in a child process through Main and keeps the 500 ms limit.

Model: opus-5-5

PR: https://git.eeqj.de/sneak/smallwebwaf/pulls/422, branch `issue-418-test-time-limits`. Most of the 503s were `waf`'s own 500 ms limit on the trap paths, rule files and Core Rule Set (`checks_timed_out`). `waf`'s tests already lifted it; the `sww` tests could not. `waf.Params` and `sww.Params` now take `BesideLookupTimeLimit` (zero keeps 500 ms). The `sww` tests give `waf` an hour and give `rproxy` a 60 s `SWW_RPROXY_WAF_BACKEND_TIMEOUT_MS`. Not covered: `TestMainRunsWAF` runs `waf` in a child process through `Main` and keeps the 500 ms limit. 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#418