Proxy timing tests outlast a hold-up of the test process (closes #53)
check / check (push) Successful in 1m53s

smallwebwaf starts each timeout as the request arrives, before the step
a test needs first: the upgrade answered, the app's buffers full, the
first part of an answer passed on. A hold-up of the test process longer
than the 300 ms timeout ran it out before that step. No test can make
that step come first, and in the "waiting on the app" cases it cannot
see which side smallwebwaf was waiting on, so the timeout is now 5 s,
the hold-up wantTimedOut already allows. The timeout tests set when it
must not run out goes from 10 s to 1 m to stay clear of it. The upgrade
test waits 7.5 s past the upgrade.

Judgement call: one shared value; the proxy tests take about 8 s, not 2 s.

Model: opus-5-5
This commit was merged in pull request #55.
This commit is contained in:
2026-10-04 07:53:18 +02:00
parent d730fcb57d
commit 6977ff73df
2 changed files with 10 additions and 5 deletions
+3 -2
View File
@@ -246,8 +246,9 @@ func TestUpgradedConnectionOutlastsTheTimeouts(t *testing.T) {
t.Fatalf("status %d, want %d", res.StatusCode, http.StatusSwitchingProtocols)
}
// Wait past every timeout, then use the connection.
time.Sleep(3 * shortTimeout)
// Every timeout started before the upgrade was answered: wait past
// them all, then use the connection.
time.Sleep(3 * shortTimeout / 2)
send(t, conn, "still here\n")
echoed, err := reader.ReadString('\n')