Test: fix some test flake in partial_tenure_forking #5769
Merged
+32
−16
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.
This should fix (some, but perhaps not all) flakiness in
partial_tenure_forking
.I think what happened in a particular run of this test is that miner 2 won the first testing tenure of the test. This, by itself, should be okay, but the problem is that the timing of the block commit pausing/unpausing and block processing are such that miner 2's first commit is actually a fork! This is because the CI runner builds the next bitcoin block before miner 2 has a chance to RBF their commit with one that points at miner 1's tenure. I solve this particular flakiness with a new Counters variable, but like my last PR that added a Counters variable, this is a kind of check we do in a lot of places. For now, trying to refactor all of the tests to be better about this is a pretty big undertaking, but its something worth keeping in mind (I'll open a refactoring issue for this).