Milestones 1 and 2: proxy with timeouts and size limits, rate limits, country lists and the image #40
@@ -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')
|
||||
|
||||
@@ -21,11 +21,15 @@ import (
|
||||
|
||||
const (
|
||||
// shortTimeout is what a test sets a timeout to, to see it run out.
|
||||
shortTimeout = 300 * time.Millisecond
|
||||
// It starts before the test has set up its case, such as an upgrade
|
||||
// or the app's buffers filling, so it is as long as the hold-up of the
|
||||
// test process that wantTimedOut allows, waitLimit/2: a shorter one
|
||||
// can run out first on a busy host.
|
||||
shortTimeout = 5 * time.Second
|
||||
// shortTimeoutSetting is shortTimeout as a setting's value.
|
||||
shortTimeoutSetting = "300ms"
|
||||
shortTimeoutSetting = "5s"
|
||||
// longTimeoutSetting is a timeout that does not run out in a test.
|
||||
longTimeoutSetting = "10s"
|
||||
longTimeoutSetting = "1m"
|
||||
// waitLimit bounds how long a test waits for what should happen.
|
||||
waitLimit = 10 * time.Second
|
||||
// pollInterval is how often a test looks for a log line.
|
||||
|
||||
Reference in New Issue
Block a user