Repository navigation
test: Fix intermittent issue in mempool_reorg - #28321
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
| assert_equal(peer1.last_message["tx"].tx.getwtxid(),tx_disconnected["tx"].getwtxid()) | ||
|
|
||
| self.nodes[1].setmocktime(int(time.time()) + 30) | ||
| self.nodes[1].setmocktime(int(time.time()) + 300) |
There was a problem hiding this comment.
Seems like due to poisson announcement timer, with a small probability, the announcement hasn't been scheduled yet. A more sure way to fix this is to revert to system time and just wait for the invs:
| self.nodes[1].setmocktime(int(time.time()) + 300) | |
| # Reset to system time | |
| self.nodes[1].setmocktime(0) | |
| peer1.wait_for_broadcast([tx_before_reorg["tx"].getwtxid(), tx_child["tx"].getwtxid(), tx_disconnected["tx"].getwtxid()]) |
(And then delete L97-101)
There was a problem hiding this comment.
wait_for_broadcast has a (default) timeout of 60 seconds, which I can use here, if you don't like the 300.
Other than that, I think it is fine to use mocktime here.
There was a problem hiding this comment.
Oh true. I suppose in the very rare scenario that it's a really long time, fastforward + immediately fail is better than waiting 60 seconds and failing. Would prefer 60 over 300 but nbd.
|
Concept ACK, thanks Marco |
| assert_equal(peer1.last_message["tx"].tx.getwtxid(),tx_disconnected["tx"].getwtxid()) | ||
|
|
||
| self.nodes[1].setmocktime(int(time.time()) + 30) | ||
| self.nodes[1].setmocktime(int(time.time()) + 300) |
There was a problem hiding this comment.
Oh true. I suppose in the very rare scenario that it's a really long time, fastforward + immediately fail is better than waiting 60 seconds and failing. Would prefer 60 over 300 but nbd.
fa5cc3c test: Fix intermittent issue in mempool_reorg (MarcoFalke) Pull request description: Currently the test case may fail intermittently, see bitcoin#28313 Fix this by changing a number and reducing the failure rate a bit. ACKs for top commit: glozow: ACK fa5cc3c Tree-SHA512: ff552111b434ca712c7dbdc5ba32a986a6fa4512cba5a756234eae69428063bf6ecfdc8f350ee84226ed4d3e4262b4639dbe49162a722e8da85f0d61e5690c51
Currently the test case may fail intermittently, see #28313
Fix this by changing a number and reducing the failure rate a bit.