From a86e63f81e9f1d3f41403170bb2e90f6a52254a0 Mon Sep 17 00:00:00 2001 From: "R.B. Boyer" Date: Thu, 5 Sep 2019 13:36:26 -0500 Subject: [PATCH] test: actually wait for the TestAgent to be fully shutdown (#6441) --- agent/testagent.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agent/testagent.go b/agent/testagent.go index 5649d3378d..b01d4e5d5e 100644 --- a/agent/testagent.go +++ b/agent/testagent.go @@ -288,7 +288,11 @@ func (a *TestAgent) Shutdown() error { // shutdown agent before endpoints defer a.Agent.ShutdownEndpoints() - return a.Agent.ShutdownAgent() + if err := a.Agent.ShutdownAgent(); err != nil { + return err + } + <-a.Agent.ShutdownCh() + return nil } func (a *TestAgent) DNSAddr() string {