From 25155aa4be42c569cdb8ab6af422bce663284ea6 Mon Sep 17 00:00:00 2001 From: Crystal Lemire Date: Fri, 27 Oct 2023 15:22:21 -0700 Subject: [PATCH] Channel cleanup. --- protocol/daemons/pricefeed/client/client_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/protocol/daemons/pricefeed/client/client_test.go b/protocol/daemons/pricefeed/client/client_test.go index 94f989bc3e2..2a8e2ce8e08 100644 --- a/protocol/daemons/pricefeed/client/client_test.go +++ b/protocol/daemons/pricefeed/client/client_test.go @@ -768,7 +768,8 @@ func TestHealthCheck(t *testing.T) { client := newClient() // Act. - // Run the price updater for a single tick with a successful update. Expect the daemon to be healthy. + // Run the price updater for a single tick with a successful update. Expect the daemon to toggle to a + // healthy state subTaskRunnerImpl.StartPriceUpdater( client, grpc_util.Ctx, @@ -781,6 +782,9 @@ func TestHealthCheck(t *testing.T) { // Assert. require.NoError(t, client.HealthCheck(grpc_util.Ctx)) + // Cleanup. + close(stop) + // Act. // Mock a failed update. In this case, we expect to see the daemon toggle to unhealthy. mockPriceFeedClient.On("UpdateMarketPrices", grpc_util.Ctx, mock.Anything). @@ -788,7 +792,8 @@ func TestHealthCheck(t *testing.T) { ticker, stop = singleTickTickerAndStop() - // Run the price updater for a single tick with a failed update. Expect the daemon to be unhealthy. + // Run the price updater for a single tick with a failed update. Expect the daemon to be toggled + // into an unhealthy state. subTaskRunnerImpl.StartPriceUpdater( client, grpc_util.Ctx, @@ -800,6 +805,9 @@ func TestHealthCheck(t *testing.T) { ) // Assert. require.Error(t, client.HealthCheck(grpc_util.Ctx)) + + // Cleanup. + close(stop) } // TestMarketUpdater_Mixed tests the `RunMarketParamUpdaterTaskLoop` function invokes the grpc