Skip to content

Commit fa748c6

Browse files
author
MarcoFalke
committed
test: Fix intermittent issue in mining_getblocktemplate_longpoll.py
1 parent 6a47337 commit fa748c6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/functional/mining_getblocktemplate_longpoll.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def run_test(self):
4141

4242
self.log.info("Test that longpoll waits if we do nothing")
4343
thr = LongpollThread(self.nodes[0])
44-
thr.start()
44+
with self.nodes[0].assert_debug_log(["ThreadRPCServer method=getblocktemplate"], timeout=3):
45+
thr.start()
4546
# check that thread still lives
4647
thr.join(5) # wait 5 seconds or until thread exits
4748
assert thr.is_alive()
@@ -55,14 +56,16 @@ def run_test(self):
5556

5657
self.log.info("Test that longpoll will terminate if we generate a block ourselves")
5758
thr = LongpollThread(self.nodes[0])
58-
thr.start()
59+
with self.nodes[0].assert_debug_log(["ThreadRPCServer method=getblocktemplate"], timeout=3):
60+
thr.start()
5961
self.generate(self.nodes[0], 1) # generate a block on own node
6062
thr.join(5) # wait 5 seconds or until thread exits
6163
assert not thr.is_alive()
6264

6365
self.log.info("Test that introducing a new transaction into the mempool will terminate the longpoll")
6466
thr = LongpollThread(self.nodes[0])
65-
thr.start()
67+
with self.nodes[0].assert_debug_log(["ThreadRPCServer method=getblocktemplate"], timeout=3):
68+
thr.start()
6669
# generate a transaction and submit it
6770
self.miniwallet.send_self_transfer(from_node=random.choice(self.nodes))
6871
# after one minute, every 10 seconds the mempool is probed, so in 80 seconds it should have returned

0 commit comments

Comments
 (0)