diff --git a/polygon/heimdall/poshttp/version_monitor_test.go b/polygon/heimdall/poshttp/version_monitor_test.go index 7c2c0b27095..128b6bf140c 100644 --- a/polygon/heimdall/poshttp/version_monitor_test.go +++ b/polygon/heimdall/poshttp/version_monitor_test.go @@ -13,6 +13,9 @@ import ( ) func TestVersioMonitorHeimdallV2(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + ctrl := gomock.NewController(t) heimdallClient := poshttp.NewMockheimdallClient(ctrl) @@ -24,13 +27,16 @@ func TestVersioMonitorHeimdallV2(t *testing.T) { FetchChainManagerStatus(gomock.Any()). Return(status, nil) - monitor := poshttp.NewVersionMonitor(context.TODO(), heimdallClient, log.New(), time.Minute) + monitor := poshttp.NewVersionMonitor(ctx, heimdallClient, log.New(), time.Minute) resolved := monitor.Version() require.Equal(t, resolved, poshttp.HeimdallV2) } func TestVersioMonitorHeimdallV1(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + ctrl := gomock.NewController(t) heimdallClient := poshttp.NewMockheimdallClient(ctrl) @@ -41,7 +47,7 @@ func TestVersioMonitorHeimdallV1(t *testing.T) { FetchChainManagerStatus(gomock.Any()). Return(status, nil) - monitor := poshttp.NewVersionMonitor(context.TODO(), heimdallClient, log.New(), time.Minute) + monitor := poshttp.NewVersionMonitor(ctx, heimdallClient, log.New(), time.Minute) resolved := monitor.Version() require.Equal(t, resolved, poshttp.HeimdallV1)