Merge pull request #3846 from tjamet/test-race-condition

Fix race condition in metric process collector test
This commit is contained in:
Kubernetes Prow Robot 2019-03-04 13:44:43 -08:00 committed by GitHub
commit c6f4ffd686
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,11 +55,13 @@ func TestProcessCollector(t *testing.T) {
} else {
t.Logf("Status: %v", status.ExitStatus())
}
done <- struct{}{}
}()
cm, err := NewNGINXProcess("pod", "default", "nginx")
if err != nil {
t.Errorf("unexpected error creating nginx status collector: %v", err)
t.FailNow()
}
go cm.Start()
@ -68,6 +70,7 @@ func TestProcessCollector(t *testing.T) {
cm.Stop()
cmd.Process.Kill()
<-done
close(done)
}()