This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Change AT discard RPC tests to be more reliable by checking discard using proposals #1411
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9789fc9
Change AT discard RPC tests to be more reliable by checking discard u…
jframe 7e542c5
only need single initial validator
jframe d471e36
check both add and remove with discard
jframe aa02a7a
Merge branch 'master' into discard_at_use_proposals
jframe b880599
Merge branch 'master' into discard_at_use_proposals
jframe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,26 +23,21 @@ public class IbftDiscardRpcAcceptanceTest extends AcceptanceTestBase { | |
|
||
@Test | ||
public void shouldDiscardVotes() throws IOException { | ||
final String[] validators = {"validator1", "validator2"}; | ||
final String[] validators = {"validator1", "validator3"}; | ||
final PantheonNode validator1 = pantheon.createIbftNodeWithValidators("validator1", validators); | ||
final PantheonNode validator2 = pantheon.createIbftNodeWithValidators("validator2", validators); | ||
final PantheonNode validator3 = pantheon.createIbftNodeWithValidators("validator3", validators); | ||
cluster.start(validator1, validator2, validator3); | ||
|
||
validator1.execute(ibftTransactions.createRemoveProposal(validator2)); | ||
validator1.execute(ibftTransactions.createAddProposal(validator3)); | ||
|
||
validator2.execute(ibftTransactions.createRemoveProposal(validator2)); | ||
validator2.execute(ibftTransactions.createAddProposal(validator3)); | ||
validator1.execute(ibftTransactions.createAddProposal(validator2)); | ||
validator1.execute(ibftTransactions.createRemoveProposal(validator3)); | ||
validator1.verify( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto; race condition around request ordering? |
||
ibft.pendingVotesEqual().addProposal(validator2).removeProposal(validator3).build()); | ||
|
||
validator1.execute(ibftTransactions.createDiscardProposal(validator2)); | ||
validator1.execute(ibftTransactions.createDiscardProposal(validator3)); | ||
validator1.verify(ibft.pendingVotesEqual().removeProposal(validator3).build()); | ||
|
||
validator1.waitUntil(wait.chainHeadHasProgressedByAtLeast(validator1, 2)); | ||
|
||
cluster.verify(ibft.validatorsEqual(validator1, validator2)); | ||
validator1.verify(ibft.noProposals()); | ||
validator2.verify( | ||
ibft.pendingVotesEqual().removeProposal(validator2).addProposal(validator3).build()); | ||
validator1.execute(ibftTransactions.createDiscardProposal(validator3)); | ||
cluster.verify(ibft.noProposals()); | ||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this a race condition? ...as you can't be entire sure of the ordering of the proposals (assuming verify checks ordering)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It actually builds a map of address, boolean so the order doesn't matter.