From d86efb83e53d29d0993912b8e85bd086190932ae Mon Sep 17 00:00:00 2001 From: Freddy Date: Tue, 23 Jul 2019 14:33:00 -0600 Subject: [PATCH] Restore NotifyListen to avoid panic in newServer retry (#6200) --- agent/consul/server_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/agent/consul/server_test.go b/agent/consul/server_test.go index 47278b78c3..1aeb1a5900 100644 --- a/agent/consul/server_test.go +++ b/agent/consul/server_test.go @@ -183,6 +183,10 @@ func newServer(c *Config) (*Server, error) { oldNotify() } } + // Restore old notify to guard against re-closing `up` on a retry + defer func() { + c.NotifyListen = oldNotify + }() // start server w := c.LogOutput