summaryrefslogtreecommitdiffhomepage
path: root/test/root/runsc_test.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2020-03-13 12:09:58 -0700
committergVisor bot <gvisor-bot@google.com>2020-03-13 12:11:13 -0700
commit722abdd8339f1df515beae0ad5272c8c2b2cfed0 (patch)
treec441bb6508dd7e66efe1820988fc079459c04562 /test/root/runsc_test.go
parentb8fda7f34f7e9629629bb0cdf7f7e72c7efdace9 (diff)
Skip process if it has exited
PiperOrigin-RevId: 300802159
Diffstat (limited to 'test/root/runsc_test.go')
-rw-r--r--test/root/runsc_test.go5
1 files changed, 5 insertions, 0 deletions
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)