From ab7c500a12823dc326b27deeeeae5cb3c62606d8 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Sun, 23 May 2021 20:41:09 +0300 Subject: [PATCH] Check use of 'maxoutboundconnections' setting in TestCore.test_bootstrap() --- src/tests/core.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tests/core.py b/src/tests/core.py index 172ae219..cf70689d 100644 --- a/src/tests/core.py +++ b/src/tests/core.py @@ -245,6 +245,16 @@ class TestCore(unittest.TestCase): self._initiate_bootstrap() self._check_connection() self._check_knownnodes() + # spend another 30 sec to check maxoutboundconnections + for _ in range(30): + time.sleep(1) + self.assertLessEqual( + len([ + con + for con in BMConnectionPool().outboundConnections.values() + if con.fullyEstablished]), + BMConfigParser().safeGetInt( + 'bitmessagesettings', 'maxoutboundconnections')) @unittest.skipIf(tor_port_free, 'no running tor detected') def test_bootstrap_tor(self):