Skip to content

Commit 0d2de46

Browse files
adonovangopherbot
authored andcommitted
gopls/internal/debug: extend timeout when running under CI builders
I don't like this but I don't have a better idea. Fixes golang/go#73982 Change-Id: I8317d1ca8f325363169b83883a67428e36cc972c Reviewed-on: https://go-review.googlesource.com/c/tools/+/680159 Auto-Submit: Alan Donovan <[email protected]> Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 578c121 commit 0d2de46

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

gopls/internal/debug/flight.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ func startFlightRecorder() (http.HandlerFunc, error) {
113113
return
114114
}
115115

116+
// Some of the CI builders can be quite heavily loaded.
117+
// Give them an extra grace period.
118+
timeout := 10 * time.Second
119+
if os.Getenv("GO_BUILDER_NAME") != "" {
120+
timeout = 1 * time.Minute
121+
}
122+
116123
select {
117124
case addr := <-urlC:
118125
// Success! Send a redirect to the new location.
@@ -122,8 +129,8 @@ func startFlightRecorder() (http.HandlerFunc, error) {
122129
case <-r.Context().Done():
123130
errorf("canceled")
124131

125-
case <-time.After(10 * time.Second):
126-
errorf("trace viewer failed to start", err)
132+
case <-time.After(timeout):
133+
errorf("trace viewer failed to start within %v", timeout)
127134
}
128135
}, nil
129136
}

0 commit comments

Comments
 (0)