From 8aec7473a1cc106d1de2e6c072b84eecc1f239b5 Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Tue, 18 Sep 2018 19:11:49 -0700 Subject: Added state machine checks for Container.Status For my own sanitity when thinking about possible transitions and state. PiperOrigin-RevId: 213559482 Change-Id: I25588c86cf6098be4eda01f4e7321c102ceef33c --- runsc/container/multi_container_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'runsc/container/multi_container_test.go') diff --git a/runsc/container/multi_container_test.go b/runsc/container/multi_container_test.go index 349ea755a..d6418efb6 100644 --- a/runsc/container/multi_container_test.go +++ b/runsc/container/multi_container_test.go @@ -378,12 +378,15 @@ func TestMultiContainerSignal(t *testing.T) { t.Errorf("failed to wait for sleep to start: %v", err) } + // goferPid is reset when container is destroyed. + goferPid := containers[1].GoferPid + // Destroy container and ensure container's gofer process has exited. if err := containers[1].Destroy(); err != nil { t.Errorf("failed to destroy container: %v", err) } _, _, err = testutil.RetryEintr(func() (uintptr, uintptr, error) { - cpid, err := syscall.Wait4(containers[1].GoferPid, nil, 0, nil) + cpid, err := syscall.Wait4(goferPid, nil, 0, nil) return uintptr(cpid), 0, err }) if err != nil && err != syscall.ECHILD { -- cgit v1.2.3