From 5f9f86a327ad4f34cab651faee0e8a0e564ef854 Mon Sep 17 00:00:00 2001
From: Pierre Souchay
Date: Fri, 3 Apr 2020 14:22:57 +0200
Subject: [PATCH] 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
---
agent/util_test.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/agent/util_test.go b/agent/util_test.go
index ae57fdea1..725a57191 100644
--- a/agent/util_test.go
+++ b/agent/util_test.go
@@ -202,7 +202,7 @@ func TestHelperProcess(t *testing.T) {
limitProcessLifetime(2 * time.Minute)
ch := make(chan os.Signal, 10)
- signal.Notify(ch)
+ signal.Notify(ch, forwardSignals...)
defer signal.Stop(ch)
fmt.Fprintf(os.Stdout, "ready\n")