Skip to content

Commit fdc542c

Browse files
authored
Merge pull request #574 from kzys/fix-multiplevm
Do not discard CreateVM's error
2 parents 5dfae2c + e84ea2e commit fdc542c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

runtime/service_integ_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,10 @@ func TestMultipleVMs_Isolated(t *testing.T) {
360360
if createVMErr != nil {
361361
matches, err := findProcess(ctx, findFirecracker)
362362
if err != nil {
363-
return err
363+
return fmt.Errorf(
364+
"failed to create a VM and couldn't find Firecracker due to %s: %w",
365+
createVMErr, err,
366+
)
364367
}
365368
return fmt.Errorf(
366369
"failed to create a VM while there are %d Firecracker processes: %w",
@@ -1984,6 +1987,12 @@ func findProcWithName(name string) func(context.Context, *process.Process) (bool
19841987
return func(ctx context.Context, p *process.Process) (bool, error) {
19851988
processExecutable, err := p.ExeWithContext(ctx)
19861989
if err != nil {
1990+
// The call above reads /proc filesystem.
1991+
// If the process is died before reading the filesystem,
1992+
// the call would return ENOENT and that's fine.
1993+
if os.IsNotExist(err) {
1994+
return false, nil
1995+
}
19871996
return false, err
19881997
}
19891998

0 commit comments

Comments
 (0)