Commit abe9818bdd

abe9818bddf2450ba1d41b858f4508ca280794d1

parent: 76df81288e

Verified · cmc ci/build: success ci/test: success

cmc <hello@cleberg.net> · 2026-09-21 21:36 UTC

e2e: drop the minimum-timeout guard

It refused a whole-package run with -timeout under fifteen minutes,
because the suite took six to fifteen and go's default is ten: the run
would otherwise panic part way through and blame whichever test held
the deadline (#143).

The suite now runs in about two minutes, so the default clears it with
room to spare and the guard only refuses reasonable commands like
`go test ./e2e -timeout 5m`. make test and .gitbay/ci.yml still pass
their own timeouts as a ceiling for a real hang.

Ref #246
e2e/main_test.go −28
@@ -1,40 +1,12 @@
11package e2e
22
33import (
4 "flag"
54 "fmt"
65 "os"
76 "testing"
8 "time"
97)
108
11// This suite drives real git, ssh, sshd and gpg, and takes six to fifteen
12// minutes depending on the machine — past `go test`'s ten-minute default.
13// Exceeding it panics with the name of whichever test happened to be
14// running, which is never the one at fault and reads like a hang (#143).
15//
16// make test passes -timeout 30m and .gitbay/ci.yml passes -timeout 20m.
17// A bare `go test ./...` gets the default, so say so up front rather than
18// eleven minutes later.
19const minTimeout = 15 * time.Minute
20
219func TestMain(m *testing.M) {
22 flag.Parse()
23 // Only for a whole-package run: `-run TestOneThing -timeout 2m` is a
24 // reasonable thing to type and none of this applies to it.
25 if run := flag.Lookup("test.run"); run == nil || run.Value.String() == "" {
26 if f := flag.Lookup("test.timeout"); f != nil {
27 d, err := time.ParseDuration(f.Value.String())
28 if err == nil && d > 0 && d < minTimeout {
29 fmt.Fprintf(os.Stderr,
30 "e2e: -timeout is %s; this suite needs about %s.\n"+
31 "Run `make test` (which passes -timeout 30m), or pass -timeout yourself.\n"+
32 "Without this check the run panics part way through and blames whichever\n"+
33 "test was executing at the deadline.\n", d, minTimeout)
34 os.Exit(1)
35 }
36 }
37 }
3810 dir, cleanup, err := makeBinDir()
3911 if err != nil {
4012 fmt.Fprintf(os.Stderr, "e2e: %v\n", err)