Skip to content

Commit

Permalink
fix: intermittent failure in feature_llmq_simplepose.py (#5859)
Browse files Browse the repository at this point in the history
## Issue being fixed or feature implemented
kudos to kwvg to report issue: he pointed out that functional tests
randomly fail lately.
Bisect pointed out an exact commit: bitcoin#20027 - mockable time
everywhere

## What was done?
Added call `mn.node.mockscheduler` as it is done in 20027 for other
functional tests

## How Has This Been Tested?
Run 20 times. Without this patch 20% failures; with this patch - zero
failures.
```
test/functional/test_runner.py -j20 feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py feature_llmq_simplepose.py
```

## Breaking Changes
N/a

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone

---------

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
  • Loading branch information
knst and UdjinM6 authored Feb 7, 2024
1 parent 9c38b35 commit 83ec7f2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/functional/feature_llmq_simplepose.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,24 @@ def repair_masternodes(self, restart):
addr = self.nodes[0].getnewaddress()
self.nodes[0].sendtoaddress(addr, 0.1)
self.nodes[0].protx('update_service', mn.proTxHash, '127.0.0.1:%d' % p2p_port(mn.node.index), mn.keyOperator, "", addr)
# Make sure this tx "safe" to mine even when InstantSend and ChainLocks are no longer functional
self.bump_mocktime(60 * 10 + 1)
self.nodes[0].generate(1)
assert not self.check_banned(mn)

if restart:
self.stop_node(mn.node.index)
self.start_masternode(mn)
else:
mn.node.setnetworkactive(True)
self.connect_nodes(mn.node.index, 0)

# syncing blocks only since node 0 has txes waiting to be mined
self.sync_blocks()

# Make sure protxes are "safe" to mine even when InstantSend and ChainLocks are no longer functional
self.bump_mocktime(60 * 10 + 1)
self.nodes[0].generate(1)
self.sync_all()

# Isolate and re-connect all MNs (otherwise there might be open connections with no MNAUTH for MNs which were banned before)
for mn in self.mninfo:
assert not self.check_banned(mn)
mn.node.setnetworkactive(False)
self.wait_until(lambda: mn.node.getconnectioncount() == 0)
mn.node.setnetworkactive(True)
Expand Down

0 comments on commit 83ec7f2

Please sign in to comment.