aboutsummaryrefslogtreecommitdiff
path: root/tests/functional_tests/p2p.py
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2020-09-06 15:49:36 +0200
committerRiccardo Spagni <ric@spagni.net>2020-09-06 15:49:37 +0200
commitaefa7740c38754b31a4f5748569ac1af59034667 (patch)
treeffb822e7c7e0929d70b706f26f29f94caec7aecd /tests/functional_tests/p2p.py
parentMerge pull request #6802 (diff)
parentfunctional_tests: add a large (many randomx epochs) p2p reorg test (diff)
downloadmonero-aefa7740c38754b31a4f5748569ac1af59034667.tar.xz
Merge pull request #6111
d20ff4f64 functional_tests: add a large (many randomx epochs) p2p reorg test (moneromooo-monero) 6a0b3b1f8 functional_tests: add randomx tests (moneromooo-monero) 9d42649d5 core: fix mining from a block that's not the current top (moneromooo-monero)
Diffstat (limited to 'tests/functional_tests/p2p.py')
-rwxr-xr-xtests/functional_tests/p2p.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/functional_tests/p2p.py b/tests/functional_tests/p2p.py
index f36e9c0b1..0b33411f9 100755
--- a/tests/functional_tests/p2p.py
+++ b/tests/functional_tests/p2p.py
@@ -139,6 +139,25 @@ class P2PTest():
assert res.height == height + 6
assert res.top_block_hash == daemon2_top_block_hash
+ # disconnect and mine a lot on daemon3
+ daemon2.out_peers(0)
+ daemon3.out_peers(0)
+ res = daemon3.generateblocks('42ey1afDFnn4886T7196doS9GPMzexD9gXpsZJDwVjeRVdFCSoHnv7KPbBeGpzJBzHRCAs9UxqeoyFQMYbqSWYTfJJQAWDm', 500)
+
+ # reconnect and wait for sync
+ daemon2.out_peers(8)
+ daemon3.out_peers(8)
+ loops = 100
+ while True:
+ res2 = daemon2.get_info()
+ res3 = daemon3.get_info()
+ if res2.top_block_hash == res3.top_block_hash:
+ break
+ time.sleep(10)
+ loops -= 1
+ assert loops >= 0
+
+
def test_p2p_tx_propagation(self):
print('Testing P2P tx propagation')
daemon2 = Daemon(idx = 2)