test(issue-18): measure the wall-clock close on the record and widen the loop worker's wall clock

Both tests ran against the public broker with second-scale budgets: the
error publish after the close can take 10-20 s, and a worker's `started`
must land before a 12 s wall clock. Assert the close time from the record's
updated_at and give the loop scenario a 30 s wall clock.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
This commit is contained in:
GodopuandClaude Fable 5.1 committed 2026-09-13 19:56:37 +09:00
1 parent 0550320590
commit d09c1627ce
2 files changed
+13 -6

No files matched your search

+5 -3
View File
@@ -936,14 +936,16 @@ def test_t1_20_loop_worker_late_completed_continues_to_reviewer(tmp_path, mock_h
"--type", "loop",
"--registry-dir", str(reg_dir),
"--workdir", str(tmp_path),
"--timeout", "12",
# wall clock wide enough that the worker's `started` (published
# over the broker) lands before it, so the idle path is what fires
"--timeout", "30",
"--idle-timeout", "2",
],
cwd=tmp_path,
timeout=60,
timeout=90,
)
stop_ev.set()
assert "Worker completed during grace period. Continuing to reviewer." in res.stdout
assert "Worker completed during grace period. Continuing to reviewer." in res.stdout, res.stdout + res.stderr
final_st = json.loads(state_file.read_text())
rev_prompts = [c for c in final_st.get("calls", []) if "agent" in c and "prompt" in c and "agt_reviewer" in c]
assert len(rev_prompts) >= 1, "Reviewer must be dispatched after worker completes during grace period"