diff options
| author | godosa <godosa@godosa.eu> | 2026-10-07 17:15:33 +0200 |
|---|---|---|
| committer | godosa <godosa@godosa.eu> | 2026-10-07 17:15:33 +0200 |
| commit | c537f4a809a564ecdab0380bcb356018f79a6900 (patch) | |
| tree | 6d4ff86965191fb3e586d37d17874c27dcf63a77 /tests | |
| parent | d678967fcf9489fd943bb17c7baf3c59f930d821 (diff) | |
| download | workflow-c537f4a809a564ecdab0380bcb356018f79a6900.tar.gz workflow-c537f4a809a564ecdab0380bcb356018f79a6900.zip | |
orch: lane cloud parks a stuck task (Cloud: no), keeps picking
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEAjUkQRrCYX5MZhWxdtj2
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_cloud.py | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/tests/test_cloud.py b/tests/test_cloud.py index e922f9c..3ac184a 100644 --- a/tests/test_cloud.py +++ b/tests/test_cloud.py @@ -1,6 +1,7 @@ import datetime as dt import io import json +import re import os import shutil import sys @@ -1163,12 +1164,42 @@ class OrchCloud(CloudProject): out = self.orch("pick", "cloud") self.assertIn("stop lane cloud: none fit (project not opted in", out) - def test_post_handback_commits_and_stops(self): + def test_post_handback_parks_and_picks_next(self): self.orch("pick", "cloud", "--id", "t-slow") self.ok("note", "t-slow", "Recovery: cloud attempt x — red") # what wf cloud pull leaves behind self.ok("status", "t-slow", "clear") out = self.orch("post", "t-slow", "cloud", "--result", "handback") self.assertIn("post: t-slow handback", out) self.assertIn("committed leftover", out) - self.assertIn("stop lane cloud: handback", out) + self.assertIn("alert: t-slow handback → tell the owner (Cloud: no", out) + self.assertIn("lane cloud keeps picking", out) + self.assertNotIn("stop lane cloud: handback", out) + self.assertIn("pick: t-yes (lane cloud", out) # next pick, not a re-send + self.assertNotIn("pick: t-slow", out) self.assertIn(" cloud opus t-slow handback ", (self.root / "out" / "wf-orch.log").read_text()) + body = (self.root / "TASKS.md").read_text().split("**t-slow**")[1].split("\n- **")[0] + self.assertIn("Cloud: no", body) + self.assertNotIn("Sessions: owner", body) # local lanes may still retry it + out = self.orch("pick", "cloud") + self.assertIn("stop lane cloud: none fit", out) # t-slow never re-sent + led = json.loads((self.d / "xdg" / "wf" / "cloud.json").read_text()) + self.assertEqual([e["id"] for e in led["entries"]], ["t-slow", "t-yes"]) + self.assertIn("pick: t-slow", self.orch("pick", "slow", "--id", "t-slow")) + + def test_post_awaiting_parks_and_picks_next(self): + self.orch("pick", "cloud", "--id", "t-slow") + hdr = self.ok("add", "-s", "awaiting", "which way? [[t-slow]]") # what wf cloud pull does + a = re.search(r"\*\*(a-[^*]+)\*\*", hdr)[1] + self.ok("status", "t-slow", "blocked", a) + out = self.orch("post", "t-slow", "cloud", "--result", f"awaiting {a}") + self.assertIn(f"alert: t-slow awaiting → tell the owner (already blocked: [[{a}]])", out) + self.assertIn("pick: t-yes (lane cloud", out) + self.assertIn(f"blocked: [[{a}]]", self.status("t-slow")) + self.assertIn("stop lane cloud: none fit", self.orch("pick", "cloud")) + + def test_post_lost_parks_too(self): + self.orch("pick", "cloud", "--id", "t-yes") + self.ok("status", "t-yes", "clear") + out = self.orch("post", "t-yes", "cloud", "--result", "lost") + self.assertIn("alert: t-yes lost → tell the owner (Cloud: no", out) + self.assertIn("pick: t-slow (lane cloud", out) |
