Currently the test case may fail intermittently, see #28313
Fix this by changing a number and reducing the failure rate a bit.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | glozow |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
91@@ -92,7 +92,7 @@ def test_reorg_relay(self):
92 # However, the node will answer requests for the tx from the recently-disconnected block.
93 assert_equal(peer1.last_message["tx"].tx.getwtxid(),tx_disconnected["tx"].getwtxid())
94
95- self.nodes[1].setmocktime(int(time.time()) + 30)
96+ self.nodes[1].setmocktime(int(time.time()) + 300)
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:
0 # Reset to system time
1 self.nodes[1].setmocktime(0)
2 peer1.wait_for_broadcast([tx_before_reorg["tx"].getwtxid(), tx_child["tx"].getwtxid(), tx_disconnected["tx"].getwtxid()])
(And then delete L97-101)
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.