Skip to content

Commit 5a97663

Browse files
committed
fix use of (*T).Fatalif from non testing goroutine
Using t.Fatalif in the goroutine will only exit the goroutine. Use t.Errorf instead to return failure to the testing function. Signed-off-by: Alakesh Haloi <[email protected]>
1 parent bbf7343 commit 5a97663

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

machine_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,8 @@ func TestWaitForSocket(t *testing.T) {
770770
time.Sleep(50 * time.Millisecond)
771771
_, err := os.Create(filename)
772772
if err != nil {
773-
t.Fatalf("Unable to create test file %s: %s", filename, err)
773+
t.Errorf("Unable to create test file %s: %s", filename, err)
774+
return
774775
}
775776
}()
776777

0 commit comments

Comments
 (0)