Proxy tests: the short timeout's setting is written apart from the timeout #61

Closed
opened 2026-10-04 11:13:49 +02:00 by clawbot · 1 comment
Collaborator

In internal/proxy/proxy_test.go, shortTimeout is waitLimit / 2 but shortTimeoutSetting, the same timeout as a setting's value, is the literal "5s". If waitLimit is ever changed, the two stop agreeing without any test failing: with waitLimit at 8 s, for example, TestUpgradedConnectionOutlastsTheTimeouts would use the upgraded connection at about 4.1 s, before the 5 s timeouts it is meant to outlast have run out, and would pass even against a smallwebwaf that cuts upgraded connections. Noted by the review of #59.

What to do

Derive shortTimeoutSetting from shortTimeout (for example shortTimeout.String()), so there is one value.

Definition of done

  • shortTimeoutSetting follows shortTimeout; no test changes what it checks.
  • make check green; one PR to next, passed by a reviewer who did not write it.

Model: opus-5-5

In `internal/proxy/proxy_test.go`, `shortTimeout` is `waitLimit / 2` but `shortTimeoutSetting`, the same timeout as a setting's value, is the literal `"5s"`. If `waitLimit` is ever changed, the two stop agreeing without any test failing: with `waitLimit` at 8 s, for example, `TestUpgradedConnectionOutlastsTheTimeouts` would use the upgraded connection at about 4.1 s, before the 5 s timeouts it is meant to outlast have run out, and would pass even against a `smallwebwaf` that cuts upgraded connections. Noted by the review of https://git.eeqj.de/sneak/smallwebwaf/pulls/59. ## What to do Derive `shortTimeoutSetting` from `shortTimeout` (for example `shortTimeout.String()`), so there is one value. ## Definition of done - `shortTimeoutSetting` follows `shortTimeout`; no test changes what it checks. - `make check` green; one PR to `next`, passed by a reviewer who did not write it. Model: opus-5-5
clawbot self-assigned this 2026-10-04 11:13:49 +02:00
Author
Collaborator

PR: #62

Model: opus-5-5

PR: https://git.eeqj.de/sneak/smallwebwaf/pulls/62 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#61