TestRequestTimeouts expects 504 when none of the body reached the app #50

Merged
clawbot merged 1 commits from issue-49-request-timeout-test into next 2026-10-04 06:09:23 +02:00
Collaborator

For #49.

Cause. In the two cases where the app reads and the client stops sending halfway, smallwebwaf waits on the client only once it has passed the first bytes of the body to the app; until then it is waiting on the app, and SPEC.md asks for 504. A test process held up for the whole 300 ms timeout before that point therefore rightly gets 504, and the test was wrong to expect 408 every time.

Change. The app in those cases records whether it received any of the body. Once the app has finished with the request, the case expects 408 and its log line if it did, and 504 and its log line if not. No change to smallwebwaf itself.

Not in the diff. app.Close() is what keeps the test from reading the app's record too early: it returns only once the app's connection has closed. The cleanup that startApp registers calls it again, which does nothing.

Disclosures

  • Unverified: a hold-up that ends in the few microseconds between smallwebwaf passing the first bytes to the app and asking the client for more, or one that stalls only the app's reading of a request it was already sent, can still make the case fail.

Model: opus-5-5

For https://git.eeqj.de/sneak/smallwebwaf/issues/49. **Cause.** In the two cases where the app reads and the client stops sending halfway, smallwebwaf waits on the client only once it has passed the first bytes of the body to the app; until then it is waiting on the app, and `SPEC.md` asks for `504`. A test process held up for the whole 300 ms timeout before that point therefore rightly gets `504`, and the test was wrong to expect `408` every time. **Change.** The app in those cases records whether it received any of the body. Once the app has finished with the request, the case expects `408` and its log line if it did, and `504` and its log line if not. No change to smallwebwaf itself. **Not in the diff.** `app.Close()` is what keeps the test from reading the app's record too early: it returns only once the app's connection has closed. The cleanup that `startApp` registers calls it again, which does nothing. **Disclosures** - Unverified: a hold-up that ends in the few microseconds between smallwebwaf passing the first bytes to the app and asking the client for more, or one that stalls only the app's reading of a request it was already sent, can still make the case fail. Model: opus-5-5
clawbot added the needs-review label 2026-10-04 05:04:27 +02:00
clawbot self-assigned this 2026-10-04 05:04:27 +02:00
clawbot added needs-rework and removed needs-review labels 2026-10-04 05:06:45 +02:00
clawbot added 1 commit 2026-10-04 05:27:23 +02:00
In the cases where the app reads and the client stops sending halfway,
smallwebwaf waits on the client only once it has passed the first bytes
of the body to the app. A test process held up for the whole 300 ms
timeout before then rightly gets 504, as SPEC.md asks, so the test was
wrong to expect 408 every time.

The app in those cases now records whether it received any of the body.
Once the app has finished with the request, the case expects 408 and its
log line if it did, and 504 and its log line if not.

Model: opus-5-5
clawbot force-pushed issue-49-request-timeout-test from 23df4310f8 to 7da6e147ef 2026-10-04 05:27:23 +02:00 Compare
clawbot changed title from Explain when TestRequestTimeouts rightly gets 504 for a stopped client to TestRequestTimeouts expects 504 when none of the body reached the app 2026-10-04 05:27:27 +02:00
Author
Collaborator

Reworked per the decision on #49 (comment): in the two cases where the client stops sending halfway, the app now records whether it received any of the body, and once it has finished with the request the case expects 408 and its log line if it did, 504 and its log line if not.
The long test comment is cut to a short one at that check; the PR body now describes the change and drops the owner's-call disclosure.

Model: opus-5-5

Reworked per the decision on https://git.eeqj.de/sneak/smallwebwaf/issues/49#issuecomment-119782: in the two cases where the client stops sending halfway, the app now records whether it received any of the body, and once it has finished with the request the case expects `408` and its log line if it did, `504` and its log line if not. The long test comment is cut to a short one at that check; the PR body now describes the change and drops the owner's-call disclosure. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-04 05:27:37 +02:00
Author
Collaborator

Review passed.
Judgement call: the two remaining failures the PR body discloses (smallwebwaf answering 504 just after the first bytes reached the app, and the app not yet having read the request when the test closes it) each need a hold-up that begins within a few microseconds, much narrower than the original failure, so they are accepted.

Model: opus-5-5

Review passed. Judgement call: the two remaining failures the PR body discloses (smallwebwaf answering `504` just after the first bytes reached the app, and the app not yet having read the request when the test closes it) each need a hold-up that begins within a few microseconds, much narrower than the original failure, so they are accepted. Model: opus-5-5
clawbot merged commit 6bd5f620f6 into next 2026-10-04 06:09:23 +02:00
clawbot deleted branch issue-49-request-timeout-test 2026-10-04 06:09:24 +02:00
clawbot removed the needs-review label 2026-10-04 06:09:25 +02:00
Sign in to join this conversation.