diff --git a/internal/lib/sandbox/sandbox.go b/internal/lib/sandbox/sandbox.go index 8530fd06762..86ec286b60a 100644 --- a/internal/lib/sandbox/sandbox.go +++ b/internal/lib/sandbox/sandbox.go @@ -409,8 +409,9 @@ func (s *Sandbox) UnmountShm() error { return nil } - // try to unmount, ignoring "not mounted" (EINVAL) error - if err := unix.Unmount(fp, unix.MNT_DETACH); err != nil && err != unix.EINVAL { + // try to unmount, ignoring "not mounted" (EINVAL) error and + // "already unmounted" (ENOENT) error + if err := unix.Unmount(fp, unix.MNT_DETACH); err != nil && err != unix.EINVAL && err != unix.ENOENT { return errors.Wrapf(err, "unable to unmount %s", fp) } diff --git a/test/stats.bats b/test/stats.bats index fd778035ed8..ba46ab3498b 100644 --- a/test/stats.bats +++ b/test/stats.bats @@ -33,15 +33,12 @@ function teardown() { @test "container stats" { # given - python -c 'import json,sys;obj=json.load(sys.stdin);obj["name"] = ["podsandbox1-sleep2"];obj["metadata"]["name"] = "podsandbox1-sleep2"; json.dump(obj, sys.stdout)' \ - < "$TESTDATA"/container_sleep.json > "$TESTDIR"/container_sleep2.json - pod_id=$(crictl runp "$TESTDATA"/sandbox_config.json) ctr1_id=$(crictl create "$pod_id" "$TESTDATA"/container_sleep.json "$TESTDATA"/sandbox_config.json) crictl start "$ctr1_id" - ctr2_id=$(crictl create "$pod_id" "$TESTDIR"/container_sleep2.json "$TESTDATA"/sandbox_config.json) + ctr2_id=$(crictl create "$pod_id" "$TESTDATA"/container_redis.json "$TESTDATA"/sandbox_config.json) crictl start "$ctr2_id" # when