Fixed unstable test TestForwardSignals()
Sometimes, in the CI, it could receive a SIGURG, producing this line: FAIL: TestForwardSignals/signal-interrupt (0.06s) util_test.go:286: expected to read line "signal: interrupt" but got "signal: urgent I/O condition" Only forward the signals we test to avoid this kind of false positive Example of such unstable errors in CI: https://circleci.com/gh/hashicorp/consul/153571
This commit is contained in:
parent
984583d980
commit
5f9f86a327
|
@ -202,7 +202,7 @@ func TestHelperProcess(t *testing.T) {
|
||||||
limitProcessLifetime(2 * time.Minute)
|
limitProcessLifetime(2 * time.Minute)
|
||||||
|
|
||||||
ch := make(chan os.Signal, 10)
|
ch := make(chan os.Signal, 10)
|
||||||
signal.Notify(ch)
|
signal.Notify(ch, forwardSignals...)
|
||||||
defer signal.Stop(ch)
|
defer signal.Stop(ch)
|
||||||
|
|
||||||
fmt.Fprintf(os.Stdout, "ready\n")
|
fmt.Fprintf(os.Stdout, "ready\n")
|
||||||
|
|
Loading…
Reference in New Issue