Skip to content

Commit da10e0b

Browse files
committed
Merge bitcoin/bitcoin#30942: test: Remove dead code from interface_zmq test
c4dc81f 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 c4dc81f tdb3: CR re ACK c4dc81f Tree-SHA512: 663a1711ba1ce04a3d2e2916e0df7a7bb51069e28bc2644b816a483628c95b5e6c29fc6eacc31a5f72b7d9af11096f3c437ea1dc57eaa1ee9ddce43cc20bacd3
2 parents e96ffa9 + c4dc81f commit da10e0b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

test/functional/interface_zmq.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -489,13 +489,8 @@ def test_mempool_sync(self):
489489
mempool_snapshot = self.nodes[0].getrawmempool(mempool_sequence=True)
490490
mempool_view = set(mempool_snapshot["txids"])
491491
get_raw_seq = mempool_snapshot["mempool_sequence"]
492-
assert_equal(get_raw_seq, 6)
493-
# Snapshot may be too old compared to zmq message we read off latest
494-
while zmq_mem_seq >= get_raw_seq:
495-
sleep(2)
496-
mempool_snapshot = self.nodes[0].getrawmempool(mempool_sequence=True)
497-
mempool_view = set(mempool_snapshot["txids"])
498-
get_raw_seq = mempool_snapshot["mempool_sequence"]
492+
assert_equal(get_raw_seq, num_txs + 1)
493+
assert zmq_mem_seq < get_raw_seq
499494

500495
# Things continue to happen in the "interim" while waiting for snapshot results
501496
# We have node 0 do all these to avoid p2p races with RBF announcements

0 commit comments

Comments
 (0)