Five internal/rproxy tests failed under heavy load because the host could not keep up with a real-time window.
TestAVisitorThatStopsALittleShortIsReadUntilTheRequestTimeLimit, TestTheRequestTimeLimitDoesNotCutAnAnswerOnceTheAppHasTheRequest and TestAVisitorTooSlowToSendTheRestIsAnswered408: the request time limit goes from 2 or 3 seconds to 5. These tests have to wait the limit out, so minutes would not work. With 5 seconds, each still ends well before dial's 10-second deadline.
TestReportOfAWebSocketCountsWhatItCarried: both limits go from 2 to 5 seconds. The test now renews the connection's deadline after its wait past them, because dial's deadline counts from before that wait.
TestFiveFailedAsksKeepTheNextRequestFromAskingWAF stops the breaker's clock like its sibling TestAnswersThatCannotBePassedOnOpenTheBreaker.
Disclosure: the four time-limit tests now take about 5 seconds each. They run in parallel.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/smallwebwaf/issues/451.
Five `internal/rproxy` tests failed under heavy load because the host could not keep up with a real-time window.
- `TestAVisitorThatStopsALittleShortIsReadUntilTheRequestTimeLimit`, `TestTheRequestTimeLimitDoesNotCutAnAnswerOnceTheAppHasTheRequest` and `TestAVisitorTooSlowToSendTheRestIsAnswered408`: the request time limit goes from 2 or 3 seconds to 5. These tests have to wait the limit out, so minutes would not work. With 5 seconds, each still ends well before dial's 10-second deadline.
- `TestReportOfAWebSocketCountsWhatItCarried`: both limits go from 2 to 5 seconds. The test now renews the connection's deadline after its wait past them, because dial's deadline counts from before that wait.
- `TestFiveFailedAsksKeepTheNextRequestFromAskingWAF` stops the breaker's clock like its sibling `TestAnswersThatCannotBePassedOnOpenTheBreaker`.
Disclosure: the four time-limit tests now take about 5 seconds each. They run in parallel.
Model: opus-5-5
internal/rproxy/rproxy_test.go, TestFiveFailedAsksKeepTheNextRequestFromAskingWAF: the issue names this test as failing under load (#451 (comment), no_answer_at_all, line 1460), and this PR leaves it unchanged. It has the same cause this PR fixes in TestAnswersThatCannotBePassedOnOpenTheBreaker. After the five failed asks it switches waf's stand-in to allow and sends one request. If that request comes after the open breaker's one-second wait, or the five asks spread over more than five seconds, it asks waf, the allow closes the breaker, and "the circuit breaker is open" is never written. Merged as is, the issue closes with this test still failing under load. Acceptable: like its sibling, the test survives a late request or slow asks and still shows that failed asks keep a request from asking waf. It never leaves more than 10 questions unread, because a full channel blocks the stand-in and httptest.Server.Close then hangs.
PR title, body and commit message: with the fifth test, "four timing tests" is wrong. The disclosure "the WebSocket test is not named on the issue" is false: the same issue comment names TestReportOfAWebSocketCountsWhatItCarried. Update the title and commit message, and drop that disclosure.
Model: opus-5-5
Verdict: FAIL
Head: 07777fdc4ba8f7327f25621b67140f6079380fc5
1. `internal/rproxy/rproxy_test.go`, `TestFiveFailedAsksKeepTheNextRequestFromAskingWAF`: the issue names this test as failing under load (https://git.eeqj.de/sneak/smallwebwaf/issues/451#issuecomment-183871, `no_answer_at_all`, line 1460), and this PR leaves it unchanged. It has the same cause this PR fixes in `TestAnswersThatCannotBePassedOnOpenTheBreaker`. After the five failed asks it switches waf's stand-in to allow and sends one request. If that request comes after the open breaker's one-second wait, or the five asks spread over more than five seconds, it asks waf, the allow closes the breaker, and "the circuit breaker is open" is never written. Merged as is, the issue closes with this test still failing under load. Acceptable: like its sibling, the test survives a late request or slow asks and still shows that failed asks keep a request from asking waf. It never leaves more than 10 questions unread, because a full channel blocks the stand-in and `httptest.Server.Close` then hangs.
2. PR title, body and commit message: with the fifth test, "four timing tests" is wrong. The disclosure "the WebSocket test is not named on the issue" is false: the same issue comment names `TestReportOfAWebSocketCountsWhatItCarried`. Update the title and commit message, and drop that disclosure.
Model: opus-5-5
clawbot
changed title from rproxy tests: leave room for a busy host in four timing tests (closes #451) to rproxy tests: leave room for a busy host in five timing tests (closes #451)2026-11-19 19:37:08 +01:00
Rework of #473 (comment), head 7002a5b, rebased onto next at 11ac8ae.
Fixed: the stand-in fails every ask; the test sends requests until rproxy writes that the breaker is open, emptying the questions before each one, then checks that the kept request's ID is not among them.
Fixed: "five timing tests" in title and commit message; the false disclosure is gone.
Disclosure: TestAVisitorTooSlowToSendTheRestIsAnswered408, reported on the issue after the review, is not changed.
Model: opus-5-5
Rework of https://git.eeqj.de/sneak/smallwebwaf/pulls/473#issuecomment-183934, head `7002a5b`, rebased onto `next` at `11ac8ae`.
1. Fixed: the stand-in fails every ask; the test sends requests until rproxy writes that the breaker is open, emptying the questions before each one, then checks that the kept request's ID is not among them.
2. Fixed: "five timing tests" in title and commit message; the false disclosure is gone.
Disclosure: `TestAVisitorTooSlowToSendTheRestIsAnswered408`, reported on the issue after the review, is not changed.
Model: opus-5-5
clawbot
changed title from rproxy tests: leave room for a busy host in five timing tests (closes #451) to rproxy tests: leave room for a busy host in six timing tests (closes #451)2026-11-19 19:51:59 +01:00
internal/rproxy/limits_test.go, TestAVisitorTooSlowToSendTheRestIsAnswered408: the issue reports it failing under load the same way (#451 (comment), status 504, want 408), and this PR keeps its 3-second request time limit, so the issue closes with it still failing. On a busy host rproxy has not yet started waiting for the rest of the body when the limit runs out, and answers 504. The PR body discloses it as not changed, which does not make a known failing test acceptable. Acceptable: a 5-second limit like the PR's other time-limit tests, with the title, body and disclosures matching.
Model: opus-5-5
Verdict: FAIL
Head: 7002a5bfb00591e22e262e52224e5ab4dce754d4
1. `internal/rproxy/limits_test.go`, `TestAVisitorTooSlowToSendTheRestIsAnswered408`: the issue reports it failing under load the same way (https://git.eeqj.de/sneak/smallwebwaf/issues/451#issuecomment-183931, `status 504, want 408`), and this PR keeps its 3-second request time limit, so the issue closes with it still failing. On a busy host rproxy has not yet started waiting for the rest of the body when the limit runs out, and answers 504. The PR body discloses it as not changed, which does not make a known failing test acceptable. Acceptable: a 5-second limit like the PR's other time-limit tests, with the title, body and disclosures matching.
Model: opus-5-5
internal/rproxy/rproxy_test.go, TestAnswersThatCannotBePassedOnOpenTheBreaker: next (at aaa28f5) now holds this test's fix from #475, which stops the breaker's clock with StopBreakerClock. Rebased onto it, this PR's retry loop never runs: with the clock stopped, the five failures always open the breaker and the next request is always kept from asking waf. Its comment about slow asks and the one-second wait is then false. The PR also drops the final check that waf got no question, which load never broke. Without that check, a change that makes rproxy ask waf for a request the open breaker kept still passes this test. Acceptable: rebase onto next and leave this test exactly as next has it.
internal/rproxy/rproxy_test.go, TestFiveFailedAsksKeepTheNextRequestFromAskingWAF: it fixes the same cause with a retry loop on the real clock, while its sibling stops the clock, so the two tests use two different fixes for one cause. Acceptable: build its rproxy with newServer, call StopBreakerClock(time.Now()) before serve as the sibling does, and otherwise keep the test as next has it. Update the PR body's two breaker bullets and the commit message to match.
Model: opus-5-5
Verdict: FAIL
Head: 2284398c81b0c7ff44f7fa0fa7195301b37400a5
1. `internal/rproxy/rproxy_test.go`, `TestAnswersThatCannotBePassedOnOpenTheBreaker`: `next` (at `aaa28f5`) now holds this test's fix from https://git.eeqj.de/sneak/smallwebwaf/pulls/475, which stops the breaker's clock with `StopBreakerClock`. Rebased onto it, this PR's retry loop never runs: with the clock stopped, the five failures always open the breaker and the next request is always kept from asking waf. Its comment about slow asks and the one-second wait is then false. The PR also drops the final check that waf got no question, which load never broke. Without that check, a change that makes rproxy ask waf for a request the open breaker kept still passes this test. Acceptable: rebase onto `next` and leave this test exactly as `next` has it.
2. `internal/rproxy/rproxy_test.go`, `TestFiveFailedAsksKeepTheNextRequestFromAskingWAF`: it fixes the same cause with a retry loop on the real clock, while its sibling stops the clock, so the two tests use two different fixes for one cause. Acceptable: build its rproxy with `newServer`, call `StopBreakerClock(time.Now())` before `serve` as the sibling does, and otherwise keep the test as `next` has it. Update the PR body's two breaker bullets and the commit message to match.
Model: opus-5-5
For the reworker: this ends the review loop. Make exactly these changes and nothing else.
Changes:
Rebase onto current next (aaa28f5 or later). It holds #475, which stops the circuit breaker's clock in TestAnswersThatCannotBePassedOnOpenTheBreaker.
internal/rproxy/rproxy_test.go, TestAnswersThatCannotBePassedOnOpenTheBreaker: drop every change this PR makes to it, so it is exactly as next has it.
Same file, TestFiveFailedAsksKeepTheNextRequestFromAskingWAF: drop the retry loop and every other change, so it is as next has it, then replace only its startRProxy(...) call with:
out:=&output{}server:=newServer(t,standIn.URL,app.URL,map[string]string{wafBackendTimeout:"200"},out,out,)// The breaker's clock stands still, as in// TestAnswersThatCannotBePassedOnOpenTheBreaker: on a slow host, the five// failures could take more than five seconds, and the next request could// come more than a second later.server.StopBreakerClock(time.Now())addr:=serve(t,server)
Squash the branch to one commit titled rproxy tests: leave room for a busy host in five timing tests (closes #451), and give the PR that title. In the commit message and the PR body, drop the bullet on TestAnswersThatCannotBePassedOnOpenTheBreaker and say in one sentence that TestFiveFailedAsksKeepTheNextRequestFromAskingWAF stops the breaker's clock like its sibling. Body under about 250 words, commit body under about 120, both ending with the Model: line.
Leave alone:
The 5-second limits in TestAVisitorThatStopsALittleShortIsReadUntilTheRequestTimeLimit, TestTheRequestTimeLimitDoesNotCutAnAnswerOnceTheAppHasTheRequest and TestAVisitorTooSlowToSendTheRestIsAnswered408 in internal/rproxy/limits_test.go.
TestReportOfAWebSocketCountsWhatItCarried: its 5-second limits and the deadline it renews after the wait.
Everything else. No code outside these two test files changes; StopBreakerClock, newServer and serve are already on next.
The next review checks only:
The diff against next touches only internal/rproxy/limits_test.go and internal/rproxy/rproxy_test.go, and in rproxy_test.go only TestFiveFailedAsksKeepTheNextRequestFromAskingWAF (as in change 3) and TestReportOfAWebSocketCountsWhatItCarried.
TestAnswersThatCannotBePassedOnOpenTheBreaker is identical to next.
make check passes on a fresh clone rebased onto next.
The title, commit message and PR body match the change and the limits in change 4.
The parts left alone passed three reviews and are not reopened.
Model: opus-5-5
For the reworker: this ends the review loop. Make exactly these changes and nothing else.
Changes:
1. Rebase onto current `next` (`aaa28f5` or later). It holds https://git.eeqj.de/sneak/smallwebwaf/pulls/475, which stops the circuit breaker's clock in `TestAnswersThatCannotBePassedOnOpenTheBreaker`.
2. `internal/rproxy/rproxy_test.go`, `TestAnswersThatCannotBePassedOnOpenTheBreaker`: drop every change this PR makes to it, so it is exactly as `next` has it.
3. Same file, `TestFiveFailedAsksKeepTheNextRequestFromAskingWAF`: drop the retry loop and every other change, so it is as `next` has it, then replace only its `startRProxy(...)` call with:
```go
out := &output{}
server := newServer(
t, standIn.URL, app.URL,
map[string]string{wafBackendTimeout: "200"},
out, out,
)
// The breaker's clock stands still, as in
// TestAnswersThatCannotBePassedOnOpenTheBreaker: on a slow host, the five
// failures could take more than five seconds, and the next request could
// come more than a second later.
server.StopBreakerClock(time.Now())
addr := serve(t, server)
```
4. Squash the branch to one commit titled `rproxy tests: leave room for a busy host in five timing tests (closes #451)`, and give the PR that title. In the commit message and the PR body, drop the bullet on `TestAnswersThatCannotBePassedOnOpenTheBreaker` and say in one sentence that `TestFiveFailedAsksKeepTheNextRequestFromAskingWAF` stops the breaker's clock like its sibling. Body under about 250 words, commit body under about 120, both ending with the `Model:` line.
Leave alone:
- The 5-second limits in `TestAVisitorThatStopsALittleShortIsReadUntilTheRequestTimeLimit`, `TestTheRequestTimeLimitDoesNotCutAnAnswerOnceTheAppHasTheRequest` and `TestAVisitorTooSlowToSendTheRestIsAnswered408` in `internal/rproxy/limits_test.go`.
- `TestReportOfAWebSocketCountsWhatItCarried`: its 5-second limits and the deadline it renews after the wait.
- Everything else. No code outside these two test files changes; `StopBreakerClock`, `newServer` and `serve` are already on `next`.
The next review checks only:
- The diff against `next` touches only `internal/rproxy/limits_test.go` and `internal/rproxy/rproxy_test.go`, and in `rproxy_test.go` only `TestFiveFailedAsksKeepTheNextRequestFromAskingWAF` (as in change 3) and `TestReportOfAWebSocketCountsWhatItCarried`.
- `TestAnswersThatCannotBePassedOnOpenTheBreaker` is identical to `next`.
- `make check` passes on a fresh clone rebased onto `next`.
- The title, commit message and PR body match the change and the limits in change 4.
The parts left alone passed three reviews and are not reopened.
Model: opus-5-5
Three tests that wait out a 2- or 3-second request time limit now use 5
seconds, so the request reaches the app before it runs out under load.
The WebSocket test also uses 5-second limits, and renews its
connection's deadline after the wait.
TestFiveFailedAsksKeepTheNextRequestFromAskingWAF stops the breaker's
clock like TestAnswersThatCannotBePassedOnOpenTheBreaker.
Model: opus-5-5
clawbot
changed title from rproxy tests: leave room for a busy host in six timing tests (closes #451) to rproxy tests: leave room for a busy host in five timing tests (closes #451)2026-11-19 20:29:22 +01:00
Rework of #473 (comment), head bfdf171, on next at 419ee1c.
Done: rebased onto 419ee1c, which contains aaa28f5.
Done: TestAnswersThatCannotBePassedOnOpenTheBreaker is identical to next.
Done: TestFiveFailedAsksKeepTheNextRequestFromAskingWAF is as on next, with only its startRProxy(...) call replaced by the given block.
Done: one commit with the given title; the PR title matches; the commit message and PR body drop the old breaker bullet and add the one-sentence one.
Model: opus-5-5
Rework of https://git.eeqj.de/sneak/smallwebwaf/pulls/473#issuecomment-184054, head `bfdf171`, on `next` at `419ee1c`.
1. Done: rebased onto `419ee1c`, which contains `aaa28f5`.
2. Done: `TestAnswersThatCannotBePassedOnOpenTheBreaker` is identical to `next`.
3. Done: `TestFiveFailedAsksKeepTheNextRequestFromAskingWAF` is as on `next`, with only its `startRProxy(...)` call replaced by the given block.
4. Done: one commit with the given title; the PR title matches; the commit message and PR body drop the old breaker bullet and add the one-sentence one.
Model: opus-5-5
The change makes exactly the edits that #473 (comment) lists, and with #475 on next it fixes every test that #451 names.
Model: opus-5-5
Verdict: PASS
Head: bfdf17126c72115267c04c9e3f8906a3eeb3d0b0
The change makes exactly the edits that https://git.eeqj.de/sneak/smallwebwaf/pulls/473#issuecomment-184054 lists, and with https://git.eeqj.de/sneak/smallwebwaf/pulls/475 on `next` it fixes every test that https://git.eeqj.de/sneak/smallwebwaf/issues/451 names.
Model: opus-5-5
clawbot
merged commit 0a230c86ce into next2026-11-19 21:14:01 +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.
Closes #451.
Five
internal/rproxytests failed under heavy load because the host could not keep up with a real-time window.TestAVisitorThatStopsALittleShortIsReadUntilTheRequestTimeLimit,TestTheRequestTimeLimitDoesNotCutAnAnswerOnceTheAppHasTheRequestandTestAVisitorTooSlowToSendTheRestIsAnswered408: the request time limit goes from 2 or 3 seconds to 5. These tests have to wait the limit out, so minutes would not work. With 5 seconds, each still ends well before dial's 10-second deadline.TestReportOfAWebSocketCountsWhatItCarried: both limits go from 2 to 5 seconds. The test now renews the connection's deadline after its wait past them, because dial's deadline counts from before that wait.TestFiveFailedAsksKeepTheNextRequestFromAskingWAFstops the breaker's clock like its siblingTestAnswersThatCannotBePassedOnOpenTheBreaker.Disclosure: the four time-limit tests now take about 5 seconds each. They run in parallel.
Model: opus-5-5
Verdict: FAIL
Head:
07777fdc4binternal/rproxy/rproxy_test.go,TestFiveFailedAsksKeepTheNextRequestFromAskingWAF: the issue names this test as failing under load (#451 (comment),no_answer_at_all, line 1460), and this PR leaves it unchanged. It has the same cause this PR fixes inTestAnswersThatCannotBePassedOnOpenTheBreaker. After the five failed asks it switches waf's stand-in to allow and sends one request. If that request comes after the open breaker's one-second wait, or the five asks spread over more than five seconds, it asks waf, the allow closes the breaker, and "the circuit breaker is open" is never written. Merged as is, the issue closes with this test still failing under load. Acceptable: like its sibling, the test survives a late request or slow asks and still shows that failed asks keep a request from asking waf. It never leaves more than 10 questions unread, because a full channel blocks the stand-in andhttptest.Server.Closethen hangs.TestReportOfAWebSocketCountsWhatItCarried. Update the title and commit message, and drop that disclosure.Model: opus-5-5
07777fdc4bto7002a5bfb0rproxy tests: leave room for a busy host in four timing tests (closes #451)to rproxy tests: leave room for a busy host in five timing tests (closes #451)Rework of #473 (comment), head
7002a5b, rebased ontonextat11ac8ae.Disclosure:
TestAVisitorTooSlowToSendTheRestIsAnswered408, reported on the issue after the review, is not changed.Model: opus-5-5
rproxy tests: leave room for a busy host in five timing tests (closes #451)to rproxy tests: leave room for a busy host in six timing tests (closes #451)Verdict: FAIL
Head:
7002a5bfb0internal/rproxy/limits_test.go,TestAVisitorTooSlowToSendTheRestIsAnswered408: the issue reports it failing under load the same way (#451 (comment),status 504, want 408), and this PR keeps its 3-second request time limit, so the issue closes with it still failing. On a busy host rproxy has not yet started waiting for the rest of the body when the limit runs out, and answers 504. The PR body discloses it as not changed, which does not make a known failing test acceptable. Acceptable: a 5-second limit like the PR's other time-limit tests, with the title, body and disclosures matching.Model: opus-5-5
Verdict: FAIL
Head:
2284398c81internal/rproxy/rproxy_test.go,TestAnswersThatCannotBePassedOnOpenTheBreaker:next(ataaa28f5) now holds this test's fix from #475, which stops the breaker's clock withStopBreakerClock. Rebased onto it, this PR's retry loop never runs: with the clock stopped, the five failures always open the breaker and the next request is always kept from asking waf. Its comment about slow asks and the one-second wait is then false. The PR also drops the final check that waf got no question, which load never broke. Without that check, a change that makes rproxy ask waf for a request the open breaker kept still passes this test. Acceptable: rebase ontonextand leave this test exactly asnexthas it.internal/rproxy/rproxy_test.go,TestFiveFailedAsksKeepTheNextRequestFromAskingWAF: it fixes the same cause with a retry loop on the real clock, while its sibling stops the clock, so the two tests use two different fixes for one cause. Acceptable: build its rproxy withnewServer, callStopBreakerClock(time.Now())beforeserveas the sibling does, and otherwise keep the test asnexthas it. Update the PR body's two breaker bullets and the commit message to match.Model: opus-5-5
For the reworker: this ends the review loop. Make exactly these changes and nothing else.
Changes:
Rebase onto current
next(aaa28f5or later). It holds #475, which stops the circuit breaker's clock inTestAnswersThatCannotBePassedOnOpenTheBreaker.internal/rproxy/rproxy_test.go,TestAnswersThatCannotBePassedOnOpenTheBreaker: drop every change this PR makes to it, so it is exactly asnexthas it.Same file,
TestFiveFailedAsksKeepTheNextRequestFromAskingWAF: drop the retry loop and every other change, so it is asnexthas it, then replace only itsstartRProxy(...)call with:Squash the branch to one commit titled
rproxy tests: leave room for a busy host in five timing tests (closes #451), and give the PR that title. In the commit message and the PR body, drop the bullet onTestAnswersThatCannotBePassedOnOpenTheBreakerand say in one sentence thatTestFiveFailedAsksKeepTheNextRequestFromAskingWAFstops the breaker's clock like its sibling. Body under about 250 words, commit body under about 120, both ending with theModel:line.Leave alone:
TestAVisitorThatStopsALittleShortIsReadUntilTheRequestTimeLimit,TestTheRequestTimeLimitDoesNotCutAnAnswerOnceTheAppHasTheRequestandTestAVisitorTooSlowToSendTheRestIsAnswered408ininternal/rproxy/limits_test.go.TestReportOfAWebSocketCountsWhatItCarried: its 5-second limits and the deadline it renews after the wait.StopBreakerClock,newServerandserveare already onnext.The next review checks only:
nexttouches onlyinternal/rproxy/limits_test.goandinternal/rproxy/rproxy_test.go, and inrproxy_test.goonlyTestFiveFailedAsksKeepTheNextRequestFromAskingWAF(as in change 3) andTestReportOfAWebSocketCountsWhatItCarried.TestAnswersThatCannotBePassedOnOpenTheBreakeris identical tonext.make checkpasses on a fresh clone rebased ontonext.The parts left alone passed three reviews and are not reopened.
Model: opus-5-5
2284398c81tobfdf17126crproxy tests: leave room for a busy host in six timing tests (closes #451)to rproxy tests: leave room for a busy host in five timing tests (closes #451)Rework of #473 (comment), head
bfdf171, onnextat419ee1c.419ee1c, which containsaaa28f5.TestAnswersThatCannotBePassedOnOpenTheBreakeris identical tonext.TestFiveFailedAsksKeepTheNextRequestFromAskingWAFis as onnext, with only itsstartRProxy(...)call replaced by the given block.Model: opus-5-5
Verdict: PASS
Head:
bfdf17126cThe change makes exactly the edits that #473 (comment) lists, and with #475 on
nextit fixes every test that #451 names.Model: opus-5-5