Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scheduled snapshot requests coming too late in snapshot_in_svnn_transition_test #64

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions tests/snapshot_in_svnn_transition_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,17 @@
success, transId = cluster.activateInstantFinality(biosFinalizer=False, waitForFinalization=False)
assert success, "Activate instant finality failed"

info = cluster.biosNode.getInfo(exitOnError=True)
snapshot_block_num = info["head_block_num"] + 1

Print(f'Schedule snapshot on snapshot node at block {snapshot_block_num}')
ret = nodeSnap.scheduleSnapshotAt(snapshot_block_num)
assert ret is not None, "Snapshot scheduling failed"
ret = nodeIrr.scheduleSnapshotAt(snapshot_block_num + 1) # intentionally different from nodeSnap
assert ret is not None, "Snapshot scheduling failed"
# Take snapshots
def takeSnapshot(node):
ret = node.createSnapshot()
assert ret is not None, "snapshot creation failed"
ret_snaphot_head_block_num = ret["payload"]["head_block_num"]
Print(f"snapshot head block number {ret_snaphot_head_block_num}")

Print("Take snapshot on nodeSnap")
takeSnapshot(nodeSnap)
Print("Take snapshot on nodeIrr")
takeSnapshot(nodeIrr)

assert cluster.biosNode.waitForTransFinalization(transId, timeout=21*12*3), f'Failed to validate transaction {transId} got rolled into a LIB block on server port {cluster.biosNode.port}'
assert cluster.biosNode.waitForLibToAdvance(), "Lib should advance after instant finality activated"
Expand Down
Loading