Check use of 'maxoutboundconnections' setting in TestCore.test_bootstrap()

This commit is contained in:
Dmitri Bogomolov 2021-05-23 20:41:09 +03:00
parent 16a11775e8
commit ab7c500a12
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -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):