Skip to content

Commit

Permalink
[avalanche] fix timestamp flakiness in abc_p2p_avalanche_remote_proof…
Browse files Browse the repository at this point in the history
…s.py

Summary:
The remote proofs returned by the `getremoteproof` RPC contain a "last_update" timestamp. To ensure the comparison between the expected and actual remote proofs does not fail because of a short timing issue, we need to ensure the inbound connection is added after the mocktime is set for the node.

The inbound connections are used for remote proofs since D14961.

Test Plan:
```
alias testr="~/dev/bitcoin-abc/build/test/functional/test_runner.py"
for i in {0..20}; do  testr abc_p2p_avalanche_remote* ; done
```

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14980
  • Loading branch information
PiRK committed Dec 13, 2023
1 parent 82b9866 commit 0e6b34d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/functional/abc_p2p_avalanche_remote_proofs.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def run_test(self):
self.disconnect_nodes(0, 1)
node = self.nodes[0]

inbound = get_ava_p2p_interface(self, node)

now = int(time.time())
node.setmocktime(now)

inbound = get_ava_p2p_interface(self, node)

outbound = node.add_outbound_p2p_connection(
AvaP2PInterface(self, node),
p2p_idx=1,
Expand Down

0 comments on commit 0e6b34d

Please sign in to comment.