Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tests: Make TestWorkerKeyChange not flaky #10320

Merged
merged 1 commit into from
Feb 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions cmd/lotus-miner/actor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ func TestWorkerKeyChange(t *testing.T) {

kit.QuietMiningLogs()

blocktime := 1 * time.Millisecond
client1, client2, miner, ens := kit.EnsembleTwoOne(t, kit.MockProofs())
blocktime := 5 * time.Millisecond
client1, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs())
Comment on lines +37 to +38
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was zero reason this test had two nodes, and with the really low block time, on lower-perf instance it was possible that the second node never caught up

ens.InterconnectAll().BeginMining(blocktime)

output := bytes.NewBuffer(nil)
Expand Down Expand Up @@ -96,7 +96,4 @@ func TestWorkerKeyChange(t *testing.T) {
// Wait for finality (worker key switch).
targetHeight := head.Height() + policy.ChainFinality
client1.WaitTillChain(ctx, kit.HeightAtLeast(targetHeight))

// Make sure the other node can catch up.
client2.WaitTillChain(ctx, kit.HeightAtLeast(targetHeight))
}