From ff85c334c7e6b527581b1112afb725b5a0ed430e Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Sat, 19 May 2018 21:27:48 +0100 Subject: [PATCH] [Tests] Fix 'Too many open files' by disabling LSD Instances of libtorrent with Local Service Discovery enabled are leaving many sockets fd open with every test run and will fail with 'Too many files open' if ulimit is >=1024. --- deluge/tests/test_alertmanager.py | 1 + deluge/tests/test_core.py | 1 + deluge/tests/test_torrent.py | 1 + deluge/tests/test_torrentmanager.py | 1 + 4 files changed, 4 insertions(+) diff --git a/deluge/tests/test_alertmanager.py b/deluge/tests/test_alertmanager.py index bca157c1d..0f740394a 100644 --- a/deluge/tests/test_alertmanager.py +++ b/deluge/tests/test_alertmanager.py @@ -17,6 +17,7 @@ class AlertManagerTestCase(BaseTestCase): def set_up(self): self.core = Core() + self.core.config.config['lsd'] = False self.am = component.get('AlertManager') return component.start(['AlertManager']) diff --git a/deluge/tests/test_core.py b/deluge/tests/test_core.py index 910ff2ed5..abf437a80 100644 --- a/deluge/tests/test_core.py +++ b/deluge/tests/test_core.py @@ -85,6 +85,7 @@ class CoreTestCase(BaseTestCase): common.set_tmp_config_dir() self.rpcserver = RPCServer(listen=False) self.core = Core() + self.core.config.config['lsd'] = False self.listen_port = 51242 return component.start().addCallback(self.start_web_server) diff --git a/deluge/tests/test_torrent.py b/deluge/tests/test_torrent.py index 328cd9a39..ceb1d35e0 100644 --- a/deluge/tests/test_torrent.py +++ b/deluge/tests/test_torrent.py @@ -39,6 +39,7 @@ class TorrentTestCase(BaseTestCase): self.setup_config() self.rpcserver = RPCServer(listen=False) self.core = Core() + self.core.config.config['lsd'] = False self.session = lt.session() self.torrent = None return component.start() diff --git a/deluge/tests/test_torrentmanager.py b/deluge/tests/test_torrentmanager.py index ea3b83f86..55ea66b32 100644 --- a/deluge/tests/test_torrentmanager.py +++ b/deluge/tests/test_torrentmanager.py @@ -31,6 +31,7 @@ class TorrentmanagerTestCase(BaseTestCase): common.set_tmp_config_dir() self.rpcserver = RPCServer(listen=False) self.core = Core() + self.core.config.config['lsd'] = False return component.start() def tear_down(self):