-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use original batch parameters in all tests except the ones that use b…
…atches and use alternate of eventuallyAll to check a collection of functions under a timeout (#190) * updates to test helpers and change in forwarding requests logic * overriding batch params in tests * use correct timeouts in tests * accounting for nomination delay
- Loading branch information
1 parent
c163dd7
commit 56181ff
Showing
20 changed files
with
188 additions
and
134 deletions.
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
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
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
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
6 changes: 3 additions & 3 deletions
6
plenum/test/checkpoints/test_discard_old_checkpoint_messages.py
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
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 |
---|---|---|
@@ -1,36 +1,37 @@ | ||
from stp_core.loop.eventually import eventually | ||
from plenum.test import waits | ||
from plenum.test.checkpoints.conftest import CHK_FREQ | ||
from plenum.test.checkpoints.helper import chkChkpoints | ||
from plenum.test.helper import sendReqsToNodesAndVerifySuffReplies | ||
|
||
|
||
def checkRequestCounts(nodes, count): | ||
def checkRequestCounts(nodes, req_count, cons_count): | ||
for node in nodes: | ||
assert len(node.requests) == count | ||
assert len(node.requests) == req_count | ||
for r in node.replicas: | ||
assert len(r.commits) == count | ||
assert len(r.prepares) == count | ||
assert len(r.commits) == cons_count | ||
assert len(r.prepares) == cons_count | ||
|
||
|
||
def testRequestOlderThanStableCheckpointRemoved(chkFreqPatched, looper, | ||
txnPoolNodeSet, client1, | ||
wallet1, client1Connected): | ||
wallet1, client1Connected, | ||
reqs_for_checkpoint): | ||
reqs = sendReqsToNodesAndVerifySuffReplies(looper, wallet1, client1, | ||
CHK_FREQ-1, 1) | ||
reqs_for_checkpoint - (chkFreqPatched.Max3PCBatchSize), 1) | ||
timeout = waits.expectedTransactionExecutionTime(len(txnPoolNodeSet)) | ||
looper.run(eventually(chkChkpoints, txnPoolNodeSet, 1, retryWait=1, | ||
timeout=timeout)) | ||
checkRequestCounts(txnPoolNodeSet, len(reqs)) | ||
sendReqsToNodesAndVerifySuffReplies(looper, wallet1, client1, 1, 1) | ||
checkRequestCounts(txnPoolNodeSet, len(reqs), chkFreqPatched.CHK_FREQ-1) | ||
sendReqsToNodesAndVerifySuffReplies(looper, wallet1, client1, | ||
chkFreqPatched.Max3PCBatchSize, 1) | ||
|
||
looper.run(eventually(chkChkpoints, txnPoolNodeSet, 1, 0, retryWait=1, | ||
timeout=timeout)) | ||
checkRequestCounts(txnPoolNodeSet, 0) | ||
checkRequestCounts(txnPoolNodeSet, 0, 0) | ||
|
||
sendReqsToNodesAndVerifySuffReplies(looper, wallet1, client1, | ||
3*CHK_FREQ + 1, 1) | ||
reqs_for_checkpoint + 1, 1) | ||
|
||
looper.run(eventually(chkChkpoints, txnPoolNodeSet, 2, 0, retryWait=1, | ||
timeout=timeout)) | ||
checkRequestCounts(txnPoolNodeSet, 1) | ||
checkRequestCounts(txnPoolNodeSet, 1, 1) |
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
Oops, something went wrong.