From 722abdd8339f1df515beae0ad5272c8c2b2cfed0 Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Fri, 13 Mar 2020 12:09:58 -0700 Subject: Skip process if it has exited PiperOrigin-RevId: 300802159 --- test/root/runsc_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/root/runsc_test.go b/test/root/runsc_test.go index 28bb60a12..90373e2db 100644 --- a/test/root/runsc_test.go +++ b/test/root/runsc_test.go @@ -18,6 +18,7 @@ import ( "bytes" "fmt" "io/ioutil" + "os" "os/exec" "path/filepath" "strconv" @@ -117,6 +118,10 @@ func sandboxPid(pid int) (int, error) { cmdline, err := ioutil.ReadFile(filepath.Join("/proc", line, "cmdline")) if err != nil { + if os.IsNotExist(err) { + // Raced with process exit. + continue + } return 0, err } args := strings.SplitN(string(cmdline), "\x00", 2) -- cgit v1.2.3