From 56b93388bc03ded367423870c604ab8e114b4b24 Mon Sep 17 00:00:00 2001 From: John Eikenberry Date: Fri, 24 Mar 2023 16:54:11 +0000 Subject: [PATCH] tests instantiating clients w/o shutting down (#16755) noticed via their port still in use messages. --- agent/consul/client_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/consul/client_test.go b/agent/consul/client_test.go index 97958b486..982eb80ab 100644 --- a/agent/consul/client_test.go +++ b/agent/consul/client_test.go @@ -824,6 +824,7 @@ func TestClient_ReloadConfig(t *testing.T) { deps := newDefaultDeps(t, &Config{NodeName: "node1", Datacenter: "dc1"}) c, err := NewClient(cfg, deps) require.NoError(t, err) + defer c.Shutdown() limiter := c.rpcLimiter.Load().(*rate.Limiter) require.Equal(t, rate.Limit(500), limiter.Limit()) @@ -869,7 +870,6 @@ func TestClient_ShortReconnectTimeout(t *testing.T) { func() bool { return len(cluster.Servers[0].LANMembersInAgentPartition()) == 2 && len(cluster.Clients[0].LANMembersInAgentPartition()) == 2 - }, time.Second, 50*time.Millisecond, @@ -901,6 +901,7 @@ func TestClient_RPC_Timeout(t *testing.T) { c.MaxQueryTime = 200 * time.Millisecond c.RPCHoldTimeout = 50 * time.Millisecond }) + defer c1.Shutdown() joinLAN(t, c1, s1) retry.Run(t, func(r *retry.R) {