aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormerge-script <fanquake@gmail.com>2024-10-28 16:32:21 +0000
committermerge-script <fanquake@gmail.com>2024-10-28 16:32:21 +0000
commitda10e0bab4a3e98868dd663af02c43b1dc8b7f4a (patch)
tree936c7d45dd18ed407b13d9d5b6143e24db540001 /test
parente96ffa98b041c847e1e4054006ef4e764882ff1b (diff)
parentc4dc81f9c6980964f63b9ad5166cd4cfaa86f3e6 (diff)
Merge bitcoin/bitcoin#30942: test: Remove dead code from interface_zmq test
c4dc81f9c6980964f63b9ad5166cd4cfaa86f3e6 test: Remove dead code from interface_zmq (Fabian Jahr) Pull request description: The loop removed here appears to be effectively dead code: In case `get_raw_seq` is behind `zmq_mem_seq` the loop runs and tries to get a more recent (higher) number for `get_raw_seq`. However, the exact number of `get_raw_seq` is asserted in the line above: `assert_equal(get_raw_seq, 6)`. If the loop would actually achieve its purpose this assert would need to be racy. This does not seem to be the case and 6 appears to be the final number. `zmq_mem_seq` however does take some time to catch up (if it were continue to be updated). But this is not handled by the loop and does not seem to be relevant at this point in the test. The backlog is consumed a bit later in another loop that handles this correctly already. ACKs for top commit: l0rinc: ACK c4dc81f9c6980964f63b9ad5166cd4cfaa86f3e6 tdb3: CR re ACK c4dc81f9c6980964f63b9ad5166cd4cfaa86f3e6 Tree-SHA512: 663a1711ba1ce04a3d2e2916e0df7a7bb51069e28bc2644b816a483628c95b5e6c29fc6eacc31a5f72b7d9af11096f3c437ea1dc57eaa1ee9ddce43cc20bacd3
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/interface_zmq.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/test/functional/interface_zmq.py b/test/functional/interface_zmq.py
index b960f40ccc..b5a71ba483 100755
--- a/test/functional/interface_zmq.py
+++ b/test/functional/interface_zmq.py
@@ -489,13 +489,8 @@ class ZMQTest (BitcoinTestFramework):
mempool_snapshot = self.nodes[0].getrawmempool(mempool_sequence=True)
mempool_view = set(mempool_snapshot["txids"])
get_raw_seq = mempool_snapshot["mempool_sequence"]
- assert_equal(get_raw_seq, 6)
- # Snapshot may be too old compared to zmq message we read off latest
- while zmq_mem_seq >= get_raw_seq:
- sleep(2)
- mempool_snapshot = self.nodes[0].getrawmempool(mempool_sequence=True)
- mempool_view = set(mempool_snapshot["txids"])
- get_raw_seq = mempool_snapshot["mempool_sequence"]
+ assert_equal(get_raw_seq, num_txs + 1)
+ assert zmq_mem_seq < get_raw_seq
# Things continue to happen in the "interim" while waiting for snapshot results
# We have node 0 do all these to avoid p2p races with RBF announcements