1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 08:17:13 +03:00

JournalLock: tests - Expand on comment about other_process_lock() section

This commit is contained in:
Athanasius 2021-03-25 10:27:13 +00:00
parent d0617ba337
commit 0811a000ed

View File

@ -43,7 +43,11 @@ from config import config
from journal_lock import JournalLock, JournalLockResult
# We need another process to already hold the lock.
###########################################################################
# For some tests (at least on Linux) we need another process to already
# hold the lock.
# This is at top level due to multiprocessing.Process wanting to
# pickle its arguments, other_process_lock() being one of them.
def other_process_lock(continue_q: mp.Queue, exit_q: mp.Queue, lockfile: pathlib.Path):
"""
Obtain the lock in a sub-process.
@ -97,6 +101,7 @@ def _obtain_lock(prefix: str, filehandle) -> bool:
return False
return True
###########################################################################
class TestJournalLock: