Skip to content

Commit

Permalink
INDY-1876: update test test_batch_rejected_and_later_ordered_on_catchup
Browse files Browse the repository at this point in the history
Signed-off-by: toktar <[email protected]>
  • Loading branch information
Toktar committed Jan 11, 2019
1 parent 9bc70fa commit 272db34
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_batch_rejected_on_catchup_start_can_be_ordered_before_ledgers_sync(
disable_transport_batching):
"""
Verifies that a batch rejected due to catch-up start can be successfully
re-applied and ordered later before ledgers synchronization without any
ordered later before ledgers synchronization without any
warnings.
In the test we perform stashing / unstashing messages and patching /
Expand All @@ -75,8 +75,7 @@ def test_batch_rejected_on_catchup_start_can_be_ordered_before_ledgers_sync(
since it is not in participating mode.
11. The slow node receives LEDGER_STATUS messages from the other nodes.
12. Prior to ledgers synchronization the slow node processes the stashed
ORDER messages. When it is processing the ORDER message from the master
replica, it re-applies the batch and orders it.
Commits messages and orders batch.
13. The slow node synchronizes its ledgers and completes the catch-up.
"""

Expand All @@ -86,8 +85,6 @@ def test_batch_rejected_on_catchup_start_can_be_ordered_before_ledgers_sync(
slow_node.nodeIbStasher.delay(cDelay(300))
slow_node.start_catchup = MethodType(patched_start_catchup, slow_node)

send_random_requests(looper, sdk_pool_handle, sdk_wallet_trust_anchor, 1)

no_more_catchups_needed_call_times_before = \
slow_node.spylog.count(Node.no_more_catchups_needed.__name__)
on_batch_rejected_call_times_before = \
Expand All @@ -97,6 +94,8 @@ def test_batch_rejected_on_catchup_start_can_be_ordered_before_ledgers_sync(
process_ordered_call_times_before = \
slow_node.spylog.count(Node.processOrdered.__name__)

send_random_requests(looper, sdk_pool_handle, sdk_wallet_trust_anchor, 1)

slow_node.start_catchup()

def check_catchup_done():
Expand All @@ -119,7 +118,7 @@ def check_catchup_done():
- on_batch_created_call_times_before == 1

assert process_ordered_call_times_after \
- process_ordered_call_times_before == 2 # one per replica
- process_ordered_call_times_before == 1 # one per replica
last_2_process_ordered_results = \
[call.result for call
in slow_node.spylog.getAll(Node.processOrdered.__name__)[-2:]]
Expand Down

0 comments on commit 272db34

Please sign in to comment.