Skip to content

Commit c69605f

Browse files
authored
Loki: Fix flaky IndexGatewayClient test (#6481)
* Stop gRPC clients in tests.
1 parent 66d3e00 commit c69605f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pkg/storage/stores/indexshipper/gatewayclient/gateway_client_test.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,15 @@ func TestDoubleRegistration(t *testing.T) {
299299
cleanup, storeAddress := createTestGrpcServer(t)
300300
t.Cleanup(cleanup)
301301

302-
_, err := NewGatewayClient(IndexGatewayClientConfig{
302+
clientCfg := IndexGatewayClientConfig{
303303
Address: storeAddress,
304-
}, r, util_log.Logger)
304+
}
305+
306+
client, err := NewGatewayClient(clientCfg, r, util_log.Logger)
305307
require.NoError(t, err)
306-
_, err = NewGatewayClient(IndexGatewayClientConfig{
307-
Address: storeAddress,
308-
}, r, util_log.Logger)
308+
defer client.Stop()
309+
310+
client, err = NewGatewayClient(clientCfg, r, util_log.Logger)
309311
require.NoError(t, err)
312+
defer client.Stop()
310313
}

0 commit comments

Comments
 (0)