diff options
| author | godosa <godosa@godosa.eu> | 2026-10-07 16:57:32 +0200 |
|---|---|---|
| committer | godosa <godosa@godosa.eu> | 2026-10-07 16:57:32 +0200 |
| commit | 61a98e767d7c45fb00b17f969c6fb42d2cbaca48 (patch) | |
| tree | 284e1c453f28a35ce12ce9f84f2053031b7c1020 /tests/test_orch.py | |
| parent | f23d7d865eb042512ebabad87e89b35b11cc1c64 (diff) | |
| download | workflow-61a98e767d7c45fb00b17f969c6fb42d2cbaca48.tar.gz workflow-61a98e767d7c45fb00b17f969c6fb42d2cbaca48.zip | |
orch: one stuck task parks itself, lane keeps picking
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEAjUkQRrCYX5MZhWxdtj2
Diffstat (limited to 'tests/test_orch.py')
| -rw-r--r-- | tests/test_orch.py | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/tests/test_orch.py b/tests/test_orch.py index 83216b2..157d7ef 100644 --- a/tests/test_orch.py +++ b/tests/test_orch.py @@ -157,9 +157,13 @@ class OrchTest(Cli): def test_post_done_without_archive_is_red(self): self.orch("pick", "fast") out = self.orch("post", "t-one", "fast", "--result", "done") - self.assertEqual(out, "post: t-one post-check-red\n no archive line for t-one\n" - "stop lane fast: post-check-red → tell the owner\n") + self.assertTrue(out.startswith( + "post: t-one post-check-red\n no archive line for t-one\n committed leftover TASKS.md tasks/archive.md\n" + "alert: t-one post-check-red → tell the owner (Sessions: owner); lane fast keeps picking\n\n" + "pick: t-two "), out) + self.assertNotIn("stop lane", out) self.assertIn(" post-check-red ", self.log()) + self.assertIn(" Sessions: owner\n", self.wf("show", "t-one")[1]) def backdate_pick(self, id="t-one", secs=125): f = self.root / ".wf" / "orch" / f"{id}.json" @@ -184,13 +188,32 @@ class OrchTest(Cli): self.assertRegex(self.log().splitlines()[-1], r" t-one done \S+ 2m0[5-9]s$") self.assertFalse((self.root / ".wf" / "orch" / "t-one.json").exists()) - def test_post_handback_commits_leftovers_and_stops(self): + def test_post_handback_parks_task_and_picks_next(self): self.orch("pick", "fast") out = self.orch("post", "t-one", "fast", "--result", "handback unclear spec") - self.assertEqual(out, "post: t-one handback\n committed leftover TASKS.md tasks/archive.md\n" - "stop lane fast: handback → tell the owner\n") + self.assertTrue(out.startswith( + "post: t-one handback\n committed leftover TASKS.md tasks/archive.md\n" + "alert: t-one handback → tell the owner (Sessions: owner, status cleared); lane fast keeps picking\n\n" + "pick: t-two (lane fast"), out) + self.assertNotIn("stop lane", out) + shown = self.wf("show", "t-one")[1] + self.assertIn(" Sessions: owner\n", shown) + self.assertIn("handback (unclear spec)", shown) + self.assertNotIn("in progress", shown.splitlines()[0]) self.assertEqual(subprocess.run(["git", "-C", str(self.root), "log", "-1", "--format=%s"], capture_output=True, text=True).stdout, "t-one handback (orchestrator)\n") + self.assertIn("Sessions: owner", subprocess.run(["git", "-C", str(self.root), "show", "HEAD:TASKS.md"], + capture_output=True, text=True).stdout) + + def test_post_awaiting_blocks_task_and_picks_next(self): + self.orch("pick", "fast") + out = self.wf("add", "-s", "awaiting", "Which way?")[1] + aid = next(w.strip("*[]:") for w in out.split() if w.strip("*[]:").startswith("a-")) + out = self.orch("post", "t-one", "fast", "--result", f"awaiting {aid}", "--no-pick") + self.assertEqual(out, f"post: t-one awaiting\n committed leftover TASKS.md tasks/archive.md\n" + f"alert: t-one awaiting → tell the owner (blocked on {aid}); lane fast keeps picking\n") + self.assertIn(f"blocked: [[{aid}]]", self.wf("show", "t-one")[1]) + self.assertIn("pick: t-two", self.orch("pick", "fast")) def test_post_done_on_slice_job_counts_as_sliced(self): self.orch("pick", "slow", "--id", "t-big") |
