fix(nayduck) - fix flaky state_sync_routed test #12821
Merged
+69
−43
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.
The test was failing when the node was slow to catch up and was still at height 0 when entering this loop:
nearcore/pytest/tests/sanity/state_sync_routed.py
Lines 106 to 107 in ba1ed9f
In this case the
hash_
here would be the genesis block hash:nearcore/pytest/tests/sanity/state_sync_routed.py
Lines 118 to 120 in ba1ed9f
The
ctx.send_moar_txs
would send it to a node that is fully caught it and has already garbage collected the genesis block. In this case the transaction would be invalid and the balance check would fail. This would in turn lead to the test being stuck forever in the final loop:nearcore/pytest/tests/sanity/state_sync_routed.py
Lines 142 to 149 in ba1ed9f
This PR contains a few fixes and improvement:
boot_node
s head's block hash when creating transactions.