summaryrefslogtreecommitdiffhomepage
path: root/runsc
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2018-06-20 15:31:12 -0700
committerShentubot <shentubot@google.com>2018-06-20 15:32:15 -0700
commit95cb01e0a9517f7119e3d848728500692a4f5cba (patch)
tree7aef449dc51c1ec69963fdfe946c104d870ff89b /runsc
parent2f59ba0e2d2169cf429b73a39a920f8d615f8eca (diff)
Reduce test sleep time
PiperOrigin-RevId: 201428433 Change-Id: I72de1e46788ec84f61513416bb690956e515907e
Diffstat (limited to 'runsc')
-rw-r--r--runsc/container/container_test.go5
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)