test: Fix intermittent issue in mining_getblocktemplate_longpoll.py
This commit is contained in:
1 file changed
+3
@@ -41,6 +41,7 @@ class GetBlockTemplateLPTest(BitcoinTestFramework):
|
|||||||
|
|
||||||
self.log.info("Test that longpoll waits if we do nothing")
|
self.log.info("Test that longpoll waits if we do nothing")
|
||||||
thr = LongpollThread(self.nodes[0])
|
thr = LongpollThread(self.nodes[0])
|
||||||
|
with self.nodes[0].assert_debug_log(["ThreadRPCServer method=getblocktemplate"], timeout=3):
|
||||||
thr.start()
|
thr.start()
|
||||||
# check that thread still lives
|
# check that thread still lives
|
||||||
thr.join(5) # wait 5 seconds or until thread exits
|
thr.join(5) # wait 5 seconds or until thread exits
|
||||||
@@ -55,6 +56,7 @@ class GetBlockTemplateLPTest(BitcoinTestFramework):
|
|||||||
|
|
||||||
self.log.info("Test that longpoll will terminate if we generate a block ourselves")
|
self.log.info("Test that longpoll will terminate if we generate a block ourselves")
|
||||||
thr = LongpollThread(self.nodes[0])
|
thr = LongpollThread(self.nodes[0])
|
||||||
|
with self.nodes[0].assert_debug_log(["ThreadRPCServer method=getblocktemplate"], timeout=3):
|
||||||
thr.start()
|
thr.start()
|
||||||
self.generate(self.nodes[0], 1) # generate a block on own node
|
self.generate(self.nodes[0], 1) # generate a block on own node
|
||||||
thr.join(5) # wait 5 seconds or until thread exits
|
thr.join(5) # wait 5 seconds or until thread exits
|
||||||
@@ -62,6 +64,7 @@ class GetBlockTemplateLPTest(BitcoinTestFramework):
|
|||||||
|
|
||||||
self.log.info("Test that introducing a new transaction into the mempool will terminate the longpoll")
|
self.log.info("Test that introducing a new transaction into the mempool will terminate the longpoll")
|
||||||
thr = LongpollThread(self.nodes[0])
|
thr = LongpollThread(self.nodes[0])
|
||||||
|
with self.nodes[0].assert_debug_log(["ThreadRPCServer method=getblocktemplate"], timeout=3):
|
||||||
thr.start()
|
thr.start()
|
||||||
# generate a transaction and submit it
|
# generate a transaction and submit it
|
||||||
self.miniwallet.send_self_transfer(from_node=random.choice(self.nodes))
|
self.miniwallet.send_self_transfer(from_node=random.choice(self.nodes))
|
||||||
|
|||||||
Reference in new issue
Block a user