tests instantiating clients w/o shutting down (#16755)

noticed via their port still in use messages.
This commit is contained in:
John Eikenberry 2023-03-24 16:54:11 +00:00 committed by GitHub
parent d61f3dafac
commit 0b1dc4ec36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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) {