Skip to content

Commit

Permalink
satellite/gracefulexit: de-flake TestNodeFailingGracefulExitWithLowOn…
Browse files Browse the repository at this point in the history
…lineScore

I can't say with certainty yet what caused the two failures I know
about, but I have one theory: the node continuing to check in during the
test skewed the online score towards 1, and using the test default for
GracefulExitDurationInDays meant there were fewer update periods than
expected.

At any rate, it is more correct to pause the graceful exit processing
chore and the contact chore during the test, even if it doesn't end up
solving the problem.

Refs: #6401
Change-Id: I06d43d531e0b3344af13878c8d55213349fdcfa3
  • Loading branch information
thepaul authored and Storj Robot committed Nov 8, 2023
1 parent 00cb237 commit 084719c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions satellite/gracefulexit/endpoint_test.go
Expand Up @@ -1931,12 +1931,16 @@ func TestNodeFailingGracefulExitWithLowOnlineScore(t *testing.T) {
config.Reputation.FlushInterval = 0
config.GracefulExit.MinimumOnlineScore = 0.6
config.GracefulExit.TimeBased = true
config.GracefulExit.GracefulExitDurationInDays = 30
},
},
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
satellite := planet.Satellites[0]
exitingNode := planet.StorageNodes[0]

exitingNode.GracefulExit.Chore.Loop.Pause()
exitingNode.Contact.Chore.Pause(ctx)

simTime := time.Now()
satellite.GracefulExit.Endpoint.SetNowFunc(func() time.Time { return simTime })
doneTime := simTime.AddDate(0, 0, satellite.Config.GracefulExit.GracefulExitDurationInDays)
Expand Down

0 comments on commit 084719c

Please sign in to comment.