diff options
author | Fabricio Voznika <fvoznika@google.com> | 2018-06-20 15:31:12 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-20 15:32:15 -0700 |
commit | 95cb01e0a9517f7119e3d848728500692a4f5cba (patch) | |
tree | 7aef449dc51c1ec69963fdfe946c104d870ff89b /runsc | |
parent | 2f59ba0e2d2169cf429b73a39a920f8d615f8eca (diff) |
Reduce test sleep time
PiperOrigin-RevId: 201428433
Change-Id: I72de1e46788ec84f61513416bb690956e515907e
Diffstat (limited to 'runsc')
-rw-r--r-- | runsc/container/container_test.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/runsc/container/container_test.go b/runsc/container/container_test.go index 1116ca170..5128f5946 100644 --- a/runsc/container/container_test.go +++ b/runsc/container/container_test.go @@ -205,7 +205,9 @@ func TestLifecycle(t *testing.T) { // Wait on the container. var wg sync.WaitGroup wg.Add(1) + ch := make(chan struct{}) go func() { + ch <- struct{}{} ws, err := s.Wait() if err != nil { t.Fatalf("error waiting on container: %v", err) @@ -218,7 +220,8 @@ func TestLifecycle(t *testing.T) { // Wait a bit to ensure that we've started waiting on the container // before we signal. - time.Sleep(5 * time.Second) + <-ch + time.Sleep(100 * time.Millisecond) // Send the container a SIGTERM which will cause it to stop. if err := s.Signal(syscall.SIGTERM); err != nil { t.Fatalf("error sending signal %v to container: %v", syscall.SIGTERM, err) |