8015: Don't use Docker logging driver. Attach stdout/stderr before starting container.
[arvados.git] / services / crunch-dispatch-local / crunch-dispatch-local_test.go
index ef8cb836c9b5727d32d7fd4fdc0ee51d0c5888c6..3ec1e2ec6b41c4759bd6f75e6cddc847254633ab 100644 (file)
@@ -145,14 +145,14 @@ func testWithServerStub(c *C, apiStubResponses map[string]arvadostest.StubRespon
        log.SetOutput(tempfile)
 
        go func() {
-               time.Sleep(1 * time.Second)
+               time.Sleep(2 * time.Second)
                sigChan <- syscall.SIGTERM
        }()
 
        runQueuedContainers(1, 1, crunchCmd)
 
-       // Give some time for run goroutine to complete
-       time.Sleep(5 * time.Second)
+       // Wait for all running crunch jobs to complete / terminate
+       waitGroup.Wait()
 
        buf, _ := ioutil.ReadFile(tempfile.Name())
        c.Check(strings.Contains(string(buf), expected), Equals, true)