From 38919f59ade714e6ec115ab896ab3ef2a196d7cb Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 20 Jul 2021 16:31:14 -0700 Subject: [PATCH] test: fix flaky window post tests Wait until the network upgrade is finished. If we try to seal while it's happening, we have a few annoying edge cases that can fail if we try to submit some messages right on the upgrade epoch (which is why everyone turns that kind of stuff off for the upgrade epoch). --- itests/wdpost_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/itests/wdpost_test.go b/itests/wdpost_test.go index e5a4fcee1..6764350cc 100644 --- a/itests/wdpost_test.go +++ b/itests/wdpost_test.go @@ -213,12 +213,18 @@ func TestWindowPostBaseFeeNoBurn(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() + sched := kit.DefaultTestUpgradeSchedule + lastUpgradeHeight := sched[len(sched)-1].Height + och := build.UpgradeClausHeight - build.UpgradeClausHeight = 10 + build.UpgradeClausHeight = lastUpgradeHeight + 1 client, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs()) ens.InterconnectAll().BeginMining(blocktime) + // Wait till all upgrades are done and we've passed the clause epoch. + client.WaitTillChain(ctx, kit.HeightAtLeast(build.UpgradeClausHeight+1)) + maddr, err := miner.ActorAddress(ctx) require.NoError(t, err) @@ -268,6 +274,12 @@ func TestWindowPostBaseFeeBurn(t *testing.T) { client, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs(), opts) ens.InterconnectAll().BeginMining(blocktime) + // Ideally we'd be a bit more precise here, but getting the information we need from the + // test framework is more work than it's worth. + // + // We just need to wait till all upgrades are done. + client.WaitTillChain(ctx, kit.HeightAtLeast(20)) + maddr, err := miner.ActorAddress(ctx) require.NoError(t, err)