fix: test: flaky TestDeadlineToggling around nulls #9354
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issues
Fixes #7809
Okay, here's the flaky failure that motivated this: https://app.circleci.com/pipelines/github/filecoin-project/lotus/23151/workflows/058fcc2a-e606-4407-93f6-5050b6b8ab32/jobs/587417.
A miner has just terminated all their sectors. We expect them to have power 0, but still have Cron active -- cron should deactivated upon the next deadline close. The test asserts that cron should be active (true) unless the tipset that executes the TerminateSectors message (one after the tipset that includes the message) is exactly equal to a deadline.Open, in which case the test asserts that cron should be inactive.
BUT, if the TerminateSectors message is included at height X, and the deadline opens at height X+1, BUT X+1 was null, then this doesn't work! The tipset that executed the TerminateSectors message is height X+2, it DOES run the cron that flips cron for this miner to inactive, but its height is NOT exactly equal to deadline.Open (it's one greater).
Proposed Changes
Make it
di.Open <= ts.Height()
.Additional Info
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, testarea
: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps