summaryrefslogtreecommitdiffhomepage
path: root/runsc/container/container_test.go
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-07-27 10:38:24 -0700
committergVisor bot <gvisor-bot@google.com>2020-07-27 10:40:29 -0700
commitd0fd97541ad767975092d4ac3ecf3814797e931c (patch)
tree531567f5fd70222261ac04f6abf6f4513ea19c89 /runsc/container/container_test.go
parent77552f1c770da7413c3c8212443328c9081901c0 (diff)
Clean-up bazel wrapper.
The bazel server was being started as the wrong user, leading to issues where the container would suddenly exit during a build. We can also simplify the waiting logic by starting the container in two separate steps: those that must complete first, then the asynchronous bit. PiperOrigin-RevId: 323391161
Diffstat (limited to 'runsc/container/container_test.go')
-rw-r--r--runsc/container/container_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/runsc/container/container_test.go b/runsc/container/container_test.go
index cd76645bd..5e8247bc8 100644
--- a/runsc/container/container_test.go
+++ b/runsc/container/container_test.go
@@ -643,7 +643,9 @@ func TestExec(t *testing.T) {
if err != nil {
t.Fatalf("error creating temporary directory: %v", err)
}
- cmd := fmt.Sprintf("ln -s /bin/true %q/symlink && sleep 100", dir)
+ // Note that some shells may exec the final command in a sequence as
+ // an optimization. We avoid this here by adding the exit 0.
+ cmd := fmt.Sprintf("ln -s /bin/true %q/symlink && sleep 100 && exit 0", dir)
spec := testutil.NewSpecWithArgs("sh", "-c", cmd)
_, bundleDir, cleanup, err := testutil.SetupContainer(spec, conf)