mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 08:56:17 +00:00
Try to fix stalling tests
This commit is contained in:
parent
09802aedaf
commit
430d5a0dad
@ -106,8 +106,8 @@ class Daemon:
|
|||||||
self.__watcher.remove_folder(folder.path)
|
self.__watcher.remove_folder(folder.path)
|
||||||
|
|
||||||
def terminate(self):
|
def terminate(self):
|
||||||
self.__stopped.set()
|
|
||||||
with Client(self.__listener.address, authkey=self.__listener._authkey) as c:
|
with Client(self.__listener.address, authkey=self.__listener._authkey) as c:
|
||||||
|
self.__stopped.set()
|
||||||
c.send(None)
|
c.send(None)
|
||||||
|
|
||||||
if self.__scanner is not None:
|
if self.__scanner is not None:
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
# Distributed under terms of the GNU AGPLv3 license.
|
# Distributed under terms of the GNU AGPLv3 license.
|
||||||
|
|
||||||
from pony.orm import db_session
|
from pony.orm import db_session
|
||||||
|
from time import sleep
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
from supysonic.daemon.server import Daemon
|
from supysonic.daemon.server import Daemon
|
||||||
@ -37,6 +38,7 @@ class ScanWithDaemonTestCase(ApiTestBase):
|
|||||||
self._daemon = Daemon(self.config)
|
self._daemon = Daemon(self.config)
|
||||||
self._thread = Thread(target=self._daemon.run)
|
self._thread = Thread(target=self._daemon.run)
|
||||||
self._thread.start()
|
self._thread.start()
|
||||||
|
sleep(0.2) # Wait a bit for the daemon thread to initialize
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self._daemon.terminate()
|
self._daemon.terminate()
|
||||||
|
Loading…
Reference in New Issue
Block a user