diff --git a/tests/test_issue78_reset.py b/tests/test_issue78_reset.py index dc9b2d2..fe6d3fa 100644 --- a/tests/test_issue78_reset.py +++ b/tests/test_issue78_reset.py @@ -1733,15 +1733,19 @@ def test_reset_waits_for_an_admitted_submit_and_sees_its_job(mam_sandbox: Path, stderr=subprocess.PIPE, text=True, ) + exclusive = "lib_py.pane_lock acquire --fd 7 --wait-env MAM_UPDATE_ADMISSION_WAIT_S" try: deadline = time.time() + 60 while time.time() < deadline: assert proc.poll() is None, proc.communicate() - if any("lib_py.pane_lock acquire --fd 7" in a for a in _descendant_args(proc.pid)): + if any(a.endswith(exclusive) for a in _descendant_args(proc.pid)): break time.sleep(0.1) else: pytest.fail("reset.sh never waited for the admission lock") + # Still blocked a second later: a shared take would have returned at once + time.sleep(1.0) + assert any(a.endswith(exclusive) for a in _descendant_args(proc.pid)) assert not (mam_sandbox / ".mam" / "reset-in-progress").exists() assert not (mam_sandbox / ".mam" / "loop-guard-active").exists() jobs_dir = mam_sandbox / ".mam" / "jobs"