Skip to content

Commit fda1746

Browse files
committed
test(hotreload): use 30s timeout to tolerate slow CI runners
caddytest's default 5s http.Client.Timeout covers the whole roundtrip, including body reads. On emulated armv7 the SSE chain (WriteFile -> e-dant/watcher -> mercure -> client) doesn't fit in 5s and the test dies with "Client.Timeout or context cancellation while reading body". Bump to 30s — generous enough for the slow runners (~5-6s actual) while keeping a bounded failure mode if the marker never arrives. Same fix is in #2431; carrying it here so this PR's CI does not trip on the unrelated flake.
1 parent 7aeeb60 commit fda1746

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

caddy/hotreload_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"strings"
1212
"sync"
1313
"testing"
14+
"time"
1415

1516
"github.com/caddyserver/caddy/v2/caddytest"
1617
"github.com/stretchr/testify/require"
@@ -25,6 +26,10 @@ func TestHotReload(t *testing.T) {
2526
indexFile := filepath.Join(tmpDir, "index.php")
2627

2728
tester := caddytest.NewTester(t)
29+
// caddytest's default 5s http.Client.Timeout is too tight for the
30+
// SSE roundtrip below on slow CI runners (notably emulated armv7).
31+
// 30s keeps the test bounded so a real regression fails fast.
32+
tester.Client.Timeout = 30 * time.Second
2833
tester.InitServer(`
2934
{
3035
debug

0 commit comments

Comments
 (0)