From 0f50b8068cd25662e1e79db0616304ffe62125b2 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Mon, 9 Dec 2024 22:43:50 +0100 Subject: [PATCH] fix test Signed-off-by: Tim Vaillancourt --- go/vt/vtorc/process/health_test.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/go/vt/vtorc/process/health_test.go b/go/vt/vtorc/process/health_test.go index c198deda4e4..fbd2917bee3 100644 --- a/go/vt/vtorc/process/health_test.go +++ b/go/vt/vtorc/process/health_test.go @@ -26,21 +26,23 @@ func TestHealthTest(t *testing.T) { defer func() { FirstDiscoveryCycleComplete.Store(false) ThisNodeHealth = &NodeHealth{} + ResetLastHealthCheckCache() }() require.Zero(t, ThisNodeHealth.LastReported) - require.False(t, ThisNodeHealth.Healthy) ThisNodeHealth = &NodeHealth{} - health, discoveredOnce := HealthTest() + health, err := HealthTest() + require.NoError(t, err) require.False(t, health.Healthy) - require.False(t, discoveredOnce) + require.False(t, health.DiscoveredOnce) require.NotZero(t, ThisNodeHealth.LastReported) ThisNodeHealth = &NodeHealth{} FirstDiscoveryCycleComplete.Store(true) - health, discoveredOnce = HealthTest() + health, err = HealthTest() + require.NoError(t, err) require.True(t, health.Healthy) - require.True(t, discoveredOnce) + require.True(t, health.DiscoveredOnce) require.NotZero(t, ThisNodeHealth.LastReported) }