Skip to content

Commit ef0c635

Browse files
committed
gopls/internal/regtest: skip builders on which regtests time out
Certain builders have been failing consistently due to regtests timing out. Attempt to clean-up the tools build dashboard by skipping the regtests on these builders when -short is set. Change-Id: Id359eb30cc5e0125e7568b972495a0599c3ccbc8 Reviewed-on: https://go-review.googlesource.com/c/tools/+/276255 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
1 parent de58e7c commit ef0c635

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

gopls/internal/regtest/runner.go

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,7 @@ type TestFunc func(t *testing.T, env *Env)
227227
// un-txtared files specified by filedata.
228228
func (r *Runner) Run(t *testing.T, files string, test TestFunc, opts ...RunOption) {
229229
t.Helper()
230-
231-
if os.Getenv("GO_BUILDER_NAME") == "openbsd-amd64-64" && testing.Short() {
232-
t.Skip("Skipping openbsd-amd64-64 due to golang.org/issues/42789.")
233-
}
230+
checkBuilder(t)
234231

235232
tests := []struct {
236233
name string
@@ -320,6 +317,32 @@ func (r *Runner) Run(t *testing.T, files string, test TestFunc, opts ...RunOptio
320317
}
321318
}
322319

320+
// longBuilders maps builders that are skipped when -short is set to a
321+
// (possibly empty) justification.
322+
var longBuilders = map[string]string{
323+
"openbsd-amd64-64": "golang.org/issues/42789",
324+
"openbsd-386-64": "golang.org/issues/42789",
325+
"openbsd-386-68": "golang.org/issues/42789",
326+
"darwin-amd64-10_12": "",
327+
"freebsd-amd64-race": "",
328+
"illumos-amd64": "",
329+
"netbsd-arm-bsiegert": "",
330+
"solaris-amd64-oraclerel": "",
331+
"windows-arm-zx2c4": "",
332+
}
333+
334+
func checkBuilder(t *testing.T) {
335+
t.Helper()
336+
builder := os.Getenv("GO_BUILDER_NAME")
337+
if reason, ok := longBuilders[builder]; ok && testing.Short() {
338+
if reason != "" {
339+
t.Skipf("Skipping %s with -short due to %s", builder, reason)
340+
} else {
341+
t.Skipf("Skipping %s with -short", builder)
342+
}
343+
}
344+
}
345+
323346
type loggingFramer struct {
324347
mu sync.Mutex
325348
buf *safeBuffer

0 commit comments

Comments
 (0)