sww tests: the other waits for the starting line end after 10 seconds #331

Closed
opened 2026-11-11 05:52:11 +01:00 by clawbot · 2 comments
Collaborator

Not blocking: a fault in tests, the same as #324 in other files of internal/sww.

Where

Each of these waits at most waitLimit (10 s) for the starting line through output.line:

  • internal/sww/waf_test.go, lines 69 and 170 (runWAF);
  • internal/sww/healthcheck_test.go, line 44;
  • internal/sww/rproxy_test.go, lines 89, 108, 542, 613, 654 and 753.

What is wrong

A start of sww waf compiles the Core Rule Set, which can take longer than 10 s on a loaded host. The wait then fails the test while sww is still starting. The fix for #324 adds output.lineBeforeExit in internal/sww/sww_test.go, which waits until the line is written or sww exits; these waits can use it where the test has sww's exit status on a channel. waf_test.go line 69 runs sww as a child process and has no such channel.

rproxy_test.go is also changed by #322; land after it to avoid a conflict.

Definition of done

  • One PR to next that changes tests only.
  • No wait for starting in internal/sww ends after a fixed time.
  • make check passes.

Model: opus-5-5

Not blocking: a fault in tests, the same as https://git.eeqj.de/sneak/smallwebwaf/issues/324 in other files of `internal/sww`. ## Where Each of these waits at most `waitLimit` (10 s) for the `starting` line through `output.line`: - `internal/sww/waf_test.go`, lines 69 and 170 (`runWAF`); - `internal/sww/healthcheck_test.go`, line 44; - `internal/sww/rproxy_test.go`, lines 89, 108, 542, 613, 654 and 753. ## What is wrong A start of `sww waf` compiles the Core Rule Set, which can take longer than 10 s on a loaded host. The wait then fails the test while sww is still starting. The fix for https://git.eeqj.de/sneak/smallwebwaf/issues/324 adds `output.lineBeforeExit` in `internal/sww/sww_test.go`, which waits until the line is written or sww exits; these waits can use it where the test has sww's exit status on a channel. `waf_test.go` line 69 runs sww as a child process and has no such channel. `rproxy_test.go` is also changed by https://git.eeqj.de/sneak/smallwebwaf/pulls/322; land after it to avoid a conflict. ## Definition of done - One PR to `next` that changes tests only. - No wait for `starting` in `internal/sww` ends after a fixed time. - `make check` passes. Model: opus-5-5
Author
Collaborator

Plan. As the issue says, after #322 lands: rebase onto it. Tests only, in internal/sww; use output.lineBeforeExit from sww_test.go where the test has sww's exit status, and give waf_test.go line 69 an equivalent that ends when the child process exits. No test, request or value is removed. Follow AGENTS.md: checks only through make targets. make fmt, then flock -w 1800 /srv/code/tmp/.gate-smallwebwaf.lock make check; a flock timeout also exits 1, so read the output. Edit by hand. Title ending (closes #331). Label the PR needs-review.

Model: opus-5-5

**Plan.** As the issue says, after https://git.eeqj.de/sneak/smallwebwaf/pulls/322 lands: rebase onto it. Tests only, in `internal/sww`; use `output.lineBeforeExit` from `sww_test.go` where the test has sww's exit status, and give `waf_test.go` line 69 an equivalent that ends when the child process exits. No test, request or value is removed. Follow `AGENTS.md`: checks only through `make` targets. `make fmt`, then `flock -w 1800 /srv/code/tmp/.gate-smallwebwaf.lock make check`; a `flock` timeout also exits 1, so read the output. Edit by hand. Title ending ` (closes #331)`. Label the PR `needs-review`. Model: opus-5-5
clawbot self-assigned this 2026-11-11 06:31:27 +01:00
Author
Collaborator

Built in #340. Every starting wait in internal/sww now ends only when the line appears or sww exits. The two child-process tests get sww's exit status from a goroutine that waits on it.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/smallwebwaf/pulls/340. Every `starting` wait in `internal/sww` now ends only when the line appears or sww exits. The two child-process tests get sww's exit status from a goroutine that waits on it. 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#331