test(reset): the submit-first test requires the reset to stay blocked on the exclusive admission (#78)

A shared take also showed `pane_lock acquire --fd 7` for an instant, so the
test passed with the old shared admission; it now matches the exclusive
argv and checks the reset is still waiting a second later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GodopuandClaude Opus 5.5 committed 2026-10-30 00:23:49 +09:00
1 parent 5c3c2eb861
commit 18ea5f6184
1 file changed
+5 -1
+5 -1
View File
@@ -1733,15 +1733,19 @@ def test_reset_waits_for_an_admitted_submit_and_sees_its_job(mam_sandbox: Path,
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
text=True, text=True,
) )
exclusive = "lib_py.pane_lock acquire --fd 7 --wait-env MAM_UPDATE_ADMISSION_WAIT_S"
try: try:
deadline = time.time() + 60 deadline = time.time() + 60
while time.time() < deadline: while time.time() < deadline:
assert proc.poll() is None, proc.communicate() 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 break
time.sleep(0.1) time.sleep(0.1)
else: else:
pytest.fail("reset.sh never waited for the admission lock") 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" / "reset-in-progress").exists()
assert not (mam_sandbox / ".mam" / "loop-guard-active").exists() assert not (mam_sandbox / ".mam" / "loop-guard-active").exists()
jobs_dir = mam_sandbox / ".mam" / "jobs" jobs_dir = mam_sandbox / ".mam" / "jobs"