From 0811a000edf8e3d454e676bec06a3d1122f911ec Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 25 Mar 2021 10:27:13 +0000 Subject: [PATCH] JournalLock: tests - Expand on comment about other_process_lock() section --- tests/journal_lock.py/test_journal_lock.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/journal_lock.py/test_journal_lock.py b/tests/journal_lock.py/test_journal_lock.py index 3334fbd4..a2ebaa63 100644 --- a/tests/journal_lock.py/test_journal_lock.py +++ b/tests/journal_lock.py/test_journal_lock.py @@ -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: