Skip to content

Commit ff4933f

Browse files
committed
Don't call Fatalf() from a new goroutine
Fatalf() calls FailNow(), which must not be called from new goroutines made by a test function. https://golang.org/pkg/testing/#B.FailNow Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent 4b4aee5 commit ff4933f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

machine_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,11 @@ func TestMicroVMExecution(t *testing.T) {
346346
defer vmmCancel()
347347
exitchannel := make(chan error)
348348
go func() {
349-
if err := m.startVMM(vmmCtx); err != nil {
349+
err := m.startVMM(vmmCtx)
350+
if err != nil {
351+
exitchannel <- err
350352
close(exitchannel)
351-
t.Fatalf("Failed to start VMM: %v", err)
353+
return
352354
}
353355
defer m.StopVMM()
354356

0 commit comments

Comments
 (0)