Publish curated Unraid-AppOps-Gateway source from ad0a390e431166c3198a2ac3bec010c2b44f2dea
This commit is contained in:
1 parent
29c1e3d5a1
commit
98d31477f9
35 files changed
+7264
-185
No files matched your search
@@ -42,6 +42,16 @@ def _sha(value: str) -> str:
|
||||
return hashlib.sha256(value.encode("ascii")).hexdigest()
|
||||
|
||||
|
||||
def _second_process_lock(path_text, started, locked):
|
||||
import fcntl
|
||||
|
||||
started.set()
|
||||
with open(path_text, "a+") as handle:
|
||||
fcntl.flock(handle, fcntl.LOCK_EX)
|
||||
locked.set()
|
||||
fcntl.flock(handle, fcntl.LOCK_UN)
|
||||
|
||||
|
||||
def test_intent_binding_matches_appops_canonical_digest() -> None:
|
||||
module = _load_store()
|
||||
idempotency = _sha("repopulse-adoption-key")
|
||||
@@ -799,19 +809,10 @@ def test_project_flock_blocks_a_second_process(store_env):
|
||||
ready = multiprocessing.Event()
|
||||
acquired = multiprocessing.Event()
|
||||
|
||||
def second_process_lock(path_text, started, locked):
|
||||
import fcntl
|
||||
|
||||
started.set()
|
||||
with open(path_text, "a+") as handle:
|
||||
fcntl.flock(handle, fcntl.LOCK_EX)
|
||||
locked.set()
|
||||
fcntl.flock(handle, fcntl.LOCK_UN)
|
||||
|
||||
with store.transaction():
|
||||
assert store.load_intent() is None
|
||||
child = multiprocessing.Process(
|
||||
target=second_process_lock,
|
||||
target=_second_process_lock,
|
||||
args=(str(module.PROJECT_LOCK), ready, acquired),
|
||||
)
|
||||
child.start()
|
||||
|
||||
Reference in new issue
Block a user