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: flaky wdPost dispute itest #12243

Merged
merged 3 commits into from
Jul 16, 2024
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
27 changes: 11 additions & 16 deletions itests/wdpost_dispute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,29 +287,24 @@ func TestWindowPostDisputeFails(t *testing.T) {
var targetDeadline uint64
waitForProof:
for {

deadlines, err := client.StateMinerDeadlines(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
for dlIdx, dl := range deadlines {
nonEmpty, err := dl.PostSubmissions.IsEmpty()
isEmpty, err := dl.PostSubmissions.IsEmpty()
require.NoError(t, err)
if nonEmpty {
if !isEmpty {
head, err := client.ChainHead(ctx)
require.NoError(t, err)
di, err := client.StateMinerProvingDeadline(ctx, maddr, head.Key())
require.NoError(t, err)
disputeEpoch := di.Close + 5
_ = client.WaitTillChain(ctx, kit.HeightAtLeast(disputeEpoch))

targetDeadline = uint64(dlIdx)
break waitForProof
}
}

build.Clock.Sleep(blocktime)
}

for {
//stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001
di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
// wait until the deadline finishes.
if di.Index == ((targetDeadline + 1) % di.WPoStPeriodDeadlines) {
break
}

build.Clock.Sleep(blocktime)
}

Expand All @@ -330,7 +325,7 @@ waitForProof:
Value: types.NewInt(0),
From: defaultFrom,
}
_, err := client.MpoolPushMessage(ctx, msg, nil)
_, err = client.MpoolPushMessage(ctx, msg, nil)
require.Error(t, err)
require.Contains(t, err.Error(), "failed to dispute valid post")
require.Contains(t, err.Error(), "(RetCode=16)")
Expand Down