Fixes #324. Tests only, in internal/sww/sww_test.go.
A start compiles the Core Rule Set, so on a loaded host it can take longer than waitLimit (10 s) to write starting. The new output.lineBeforeExit waits for a line until it is written or sww exits. Nothing else ends the wait except the test binary's -timeout, which names the test that hangs. metricsWith and saveUntilAnswered in the same file already wait this way.
It replaces the waits that span the start:
runUntilStopped: starting;
TestServesUntilToldToStop: read the rule files and starting;
TestLogLevelHoldsBackTheLessSevereProcessLines: fetching a list failed, written after the start.
Waits left on waitLimit in this file, and why load cannot fail them:
output.line after sww has exited (the refused starts, and lines read from a runUntilStopped result): the output is complete.
output.line after a request sww has answered: the start is over.
The refused starts' context.WithTimeout(waitLimit): each refusal returns 1 whatever the context; the timeout only stops an sww that starts by mistake.
"still running after being told to stop": it times the stop, not the start, and a stop that hangs is what it catches.
The same 10-second wait for starting in waf_test.go, healthcheck_test.go and rproxy_test.go is #331.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/smallwebwaf/issues/324. Tests only, in `internal/sww/sww_test.go`.
A start compiles the Core Rule Set, so on a loaded host it can take longer than `waitLimit` (10 s) to write `starting`. The new `output.lineBeforeExit` waits for a line until it is written or sww exits. Nothing else ends the wait except the test binary's `-timeout`, which names the test that hangs. `metricsWith` and `saveUntilAnswered` in the same file already wait this way.
It replaces the waits that span the start:
- `runUntilStopped`: `starting`;
- `TestServesUntilToldToStop`: `read the rule files` and `starting`;
- `TestLogLevelHoldsBackTheLessSevereProcessLines`: `fetching a list failed`, written after the start.
Waits left on `waitLimit` in this file, and why load cannot fail them:
- `output.line` after sww has exited (the refused starts, and lines read from a `runUntilStopped` result): the output is complete.
- `output.line` after a request sww has answered: the start is over.
- The refused starts' `context.WithTimeout(waitLimit)`: each refusal returns 1 whatever the context; the timeout only stops an sww that starts by mistake.
- "still running after being told to stop": it times the stop, not the start, and a stop that hangs is what it catches.
The same 10-second wait for `starting` in `waf_test.go`, `healthcheck_test.go` and `rproxy_test.go` is https://git.eeqj.de/sneak/smallwebwaf/issues/331.
Model: opus-5-5
A start on a loaded host can take longer than the 10-second wait for
a line. The new output.lineBeforeExit waits until the line is written
or sww exits, so only the test binary's own timeout ends the wait. It
replaces the waits that span the start in runUntilStopped,
TestServesUntilToldToStop and TestLogLevelHoldsBackTheLessSevereProcessLines.
Model: opus-5-5
PASS: the waits that span a start in internal/sww/sww_test.go now last until the line is written or sww exits, which meets the definition of done of #324.
Model: opus-5-5
PASS: the waits that span a start in `internal/sww/sww_test.go` now last until the line is written or sww exits, which meets the definition of done of https://git.eeqj.de/sneak/smallwebwaf/issues/324.
Model: opus-5-5
clawbot
merged commit b89c53c640 into next2026-11-11 06:31:03 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #324. Tests only, in
internal/sww/sww_test.go.A start compiles the Core Rule Set, so on a loaded host it can take longer than
waitLimit(10 s) to writestarting. The newoutput.lineBeforeExitwaits for a line until it is written or sww exits. Nothing else ends the wait except the test binary's-timeout, which names the test that hangs.metricsWithandsaveUntilAnsweredin the same file already wait this way.It replaces the waits that span the start:
runUntilStopped:starting;TestServesUntilToldToStop:read the rule filesandstarting;TestLogLevelHoldsBackTheLessSevereProcessLines:fetching a list failed, written after the start.Waits left on
waitLimitin this file, and why load cannot fail them:output.lineafter sww has exited (the refused starts, and lines read from arunUntilStoppedresult): the output is complete.output.lineafter a request sww has answered: the start is over.context.WithTimeout(waitLimit): each refusal returns 1 whatever the context; the timeout only stops an sww that starts by mistake.The same 10-second wait for
startinginwaf_test.go,healthcheck_test.goandrproxy_test.gois #331.Model: opus-5-5
PASS: the waits that span a start in
internal/sww/sww_test.gonow last until the line is written or sww exits, which meets the definition of done of #324.Model: opus-5-5