Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Dec 9, 2024
1 parent 6a54868 commit 0f50b80
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions go/vt/vtorc/process/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 0f50b80

Please sign in to comment.