try to deflake window post itests.

This commit is contained in:
Raúl Kripalani 2021-06-22 17:07:14 +01:00
parent 098eb6bfff
commit 9b2efd5ace

View File

@ -49,26 +49,11 @@ func TestWindowPostDispute(t *testing.T) {
Miner(&evilMiner, &client, opts, kit.PresealSectors(0)).
Start()
{
addrinfo, err := client.NetAddrsListen(ctx)
if err != nil {
t.Fatal(err)
}
if err := chainMiner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
if err := evilMiner.NetConnect(ctx, addrinfo); err != nil {
t.Fatal(err)
}
}
defaultFrom, err := client.WalletDefaultAddress(ctx)
require.NoError(t, err)
// Mine with the _second_ node (the good one).
ens.BeginMining(blocktime, &chainMiner)
ens.InterconnectAll().BeginMining(blocktime, &chainMiner)
// Give the chain miner enough sectors to win every block.
chainMiner.PledgeSectors(ctx, 10, 0, nil)
@ -84,7 +69,7 @@ func TestWindowPostDispute(t *testing.T) {
t.Logf("Running one proving period\n")
waitUntil := di.PeriodStart + di.WPoStProvingPeriod*2
waitUntil := di.PeriodStart + di.WPoStProvingPeriod*2 + 1
t.Logf("End for head.Height > %d", waitUntil)
ts := client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil))
@ -257,7 +242,7 @@ func TestWindowPostDisputeFails(t *testing.T) {
require.NoError(t, err)
t.Log("Running one proving period")
waitUntil := di.PeriodStart + di.WPoStProvingPeriod*2
waitUntil := di.PeriodStart + di.WPoStProvingPeriod*2 + 1
t.Logf("End for head.Height > %d", waitUntil)
ts := client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil))