[3.1] plugin_http_api_test - fix timing issue #387
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.
Backports: EOSIO/eos#10103
From EOSIO/eos#10103:
Consider the following scenario:
The overall plan is to activate a total of 17 protocol features.
The first 5 protocol features are activated and added to some block (let's say block 18).
While still on block 18, the remaining 12 protocol features transactions are executed (and they will be added to block 19, and the features will be active on block 20), and the check for waitForHeadToAdvance also gets executed while we are still on this block 18.
When the chain advances to block 19, the waitForHeadToAdvance method returns, but only 5 protocol features are really activated, leading to a state on the chain where we return from this method, but the protocol features are in realityy still not activated, leading to some failure on some further asserts that assume that this is the case after we return from preactivateAllBuiltinProtocolFeature.
Solution:
To handle this edge case, we wait 2 blocks, instead of 1, to make sure that all the transactions for protocol feature activations are executed and activated, also modify the timeout of the check for head advance to be proportional to the number of blocks we want to wait to advance.
Resolves #386