From 606b6d7d08fcc5515b70ecb20f394ea3dbbf2bc1 Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Wed, 20 Dec 2023 03:02:42 +0200 Subject: [PATCH] Explicitly enable UDP in TestNetwork adding Announcer to the expected threads --- src/tests/test_network.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/tests/test_network.py b/src/tests/test_network.py index e6a05717..cbdcb903 100644 --- a/src/tests/test_network.py +++ b/src/tests/test_network.py @@ -19,6 +19,7 @@ class TestNetwork(TestPartialRun): cls.state.maximumNumberOfHalfOpenConnections = 4 cls.config.set('bitmessagesettings', 'sendoutgoingconnections', 'True') + cls.config.set('bitmessagesettings', 'udp', 'True') # config variable is still used inside of the network ): import network @@ -34,18 +35,14 @@ class TestNetwork(TestPartialRun): def test_threads(self): """Ensure all the network threads started""" threads = { - "AddrBroadcaster", "Asyncore", "Downloader", "InvBroadcaster", - "Uploader"} - extra = ( - self.config.getint('threads', 'receive') - + self.config.safeGetBoolean('bitmessagesettings', 'udp')) + "AddrBroadcaster", "Announcer", "Asyncore", "Downloader", + "InvBroadcaster", "Uploader"} + extra = self.config.getint('threads', 'receive') for thread in threading.enumerate(): try: threads.remove(thread.name) except KeyError: - extra -= ( - thread.name == "Announcer" - or thread.name.startswith("ReceiveQueue_")) + extra -= thread.name.startswith("ReceiveQueue_") self.assertEqual(len(threads), 0) self.assertEqual(extra, 0)