Skip to content

Commit 784fe34

Browse files
committed
go/ssa/interp: abort long-running test when testing.Short() is set
This should help on slower machines. For golang/go#11811. Change-Id: Ibb5d5bf0f6cedcda6437ef0ee3fc1f4ba89dab90 Reviewed-on: https://go-review.googlesource.com/13009 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent d89a972 commit 784fe34

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

go/ssa/interp/interp_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,12 @@ func success(exitcode int, output string) error {
291291
// TestTestdataFiles runs the interpreter on testdata/*.go.
292292
func TestTestdataFiles(t *testing.T) {
293293
var failures []string
294+
start := time.Now()
294295
for _, input := range testdataTests {
296+
if testing.Short() && time.Since(start) > 30*time.Second {
297+
printFailures(failures)
298+
t.Skipf("timeout - aborting test")
299+
}
295300
if !run(t, "testdata"+slash, input, success) {
296301
failures = append(failures, input)
297302
}

0 commit comments

Comments
 (0)