summaryrefslogtreecommitdiffhomepage
path: root/runsc/container/multi_container_test.go
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2019-01-11 10:31:21 -0800
committerShentubot <shentubot@google.com>2019-01-11 10:32:26 -0800
commitf8c8f241540fa79b47090ce4808c2c0cfbe44a12 (patch)
tree493726adeeb4f6c38619ec49c42cbd72d0578097 /runsc/container/multi_container_test.go
parentbde588ff05cad3591025a1e313eebe61cd82e421 (diff)
runsc: Collect zombies of sandbox and gofer processes
And we need to wait a gofer process before cgroup.Uninstall, because it is running in the sandbox cgroups. PiperOrigin-RevId: 228904020 Change-Id: Iaf8826d5b9626db32d4057a1c505a8d7daaeb8f9
Diffstat (limited to 'runsc/container/multi_container_test.go')
-rw-r--r--runsc/container/multi_container_test.go16
1 files changed, 7 insertions, 9 deletions
diff --git a/runsc/container/multi_container_test.go b/runsc/container/multi_container_test.go
index e431f5aec..6b3c41a9b 100644
--- a/runsc/container/multi_container_test.go
+++ b/runsc/container/multi_container_test.go
@@ -359,7 +359,7 @@ func TestMultiContainerSignal(t *testing.T) {
cpid, err := syscall.Wait4(goferPid, nil, 0, nil)
return uintptr(cpid), 0, err
})
- if err != nil && err != syscall.ECHILD {
+ if err != syscall.ECHILD {
t.Errorf("error waiting for gofer to exit: %v", err)
}
// Make sure process 1 is still running.
@@ -379,18 +379,12 @@ func TestMultiContainerSignal(t *testing.T) {
}
// Ensure that container's gofer and sandbox process are no more.
- _, _, err = testutil.RetryEintr(func() (uintptr, uintptr, error) {
- cpid, err := syscall.Wait4(containers[0].GoferPid, nil, 0, nil)
- return uintptr(cpid), 0, err
- })
+ err = blockUntilWaitable(containers[0].GoferPid)
if err != nil && err != syscall.ECHILD {
t.Errorf("error waiting for gofer to exit: %v", err)
}
- _, _, err = testutil.RetryEintr(func() (uintptr, uintptr, error) {
- cpid, err := syscall.Wait4(containers[0].Sandbox.Pid, nil, 0, nil)
- return uintptr(cpid), 0, err
- })
+ err = blockUntilWaitable(containers[0].Sandbox.Pid)
if err != nil && err != syscall.ECHILD {
t.Errorf("error waiting for sandbox to exit: %v", err)
}
@@ -399,6 +393,10 @@ func TestMultiContainerSignal(t *testing.T) {
if err := containers[0].SignalContainer(syscall.SIGKILL, false); err == nil {
t.Errorf("sandbox %q shouldn't exist, but we were able to signal it", containers[0].Sandbox.ID)
}
+
+ if err := containers[0].Destroy(); err != nil {
+ t.Errorf("failed to destroy container: %v", err)
+ }
}
}