Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_feature_proof_cleanup.py
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
mocktime += AVALANCHE_DANGLING_PROOF_TIMEOUT - 1 | mocktime += AVALANCHE_DANGLING_PROOF_TIMEOUT - 1 | ||||
node.setmocktime(mocktime) | node.setmocktime(mocktime) | ||||
# Run the cleanup, the proofs are still there | # Run the cleanup, the proofs are still there | ||||
node.mockscheduler(AVALANCHE_CLEANUP_INTERVAL) | node.mockscheduler(AVALANCHE_CLEANUP_INTERVAL) | ||||
assert_equal(len(peer_info), 11) | assert_equal(len(peer_info), 11) | ||||
self.log.info("Check the proofs with attached nodes are not cleaned") | self.log.info("Check the proofs with attached nodes are not cleaned") | ||||
# Run the cleanup, the proofs with no node are cleaned excepted our | |||||
# local proof | |||||
with node.assert_debug_log(["Proof dropped for dangling too long (no connected node): {}".format(uint256_hex(p.proofid)) for p in proofs[6:]]): | |||||
# Expire the dangling proof timeout | # Expire the dangling proof timeout | ||||
mocktime += 1 | mocktime += 1 | ||||
node.setmocktime(mocktime) | node.setmocktime(mocktime) | ||||
# Run the cleanup, the proofs with no node are cleaned excepted our | |||||
# local proof | |||||
with node.assert_debug_log(["Proof dropped for dangling too long (no connected node): {}".format(uint256_hex(p.proofid)) for p in proofs[6:]]): | |||||
node.mockscheduler(AVALANCHE_CLEANUP_INTERVAL) | node.mockscheduler(AVALANCHE_CLEANUP_INTERVAL) | ||||
self.wait_until(lambda: set(get_proof_ids(node)) == set( | self.wait_until(lambda: set(get_proof_ids(node)) == set( | ||||
[proof.proofid for proof in proofs[:6]]), timeout=5) | [proof.proofid for proof in proofs[:6]]), timeout=5) | ||||
self.log.info( | self.log.info( | ||||
"Check the proofs are cleaned on next cleanup after the nodes disconnected") | "Check the proofs are cleaned on next cleanup after the nodes disconnected") | ||||
for peer in peers: | for peer in peers: | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |