Kill the two surviving mutants of the headless claude calls
CI / tests (pull_request) Has been cancelled
CI / tests (pull_request) Has been cancelled
This commit is contained in:
@@ -36,7 +36,11 @@ class StuckWorkers(unittest.TestCase):
|
||||
if each_check:
|
||||
streamed.shells = lambda: [each_check.pop(0)]
|
||||
fake = FakeEffects(streams=[streamed], claude=replies)
|
||||
effects = dataclasses.replace(fake.effects(), now=lambda: clock[0])
|
||||
self.claude_folders = []
|
||||
def claude(args, cwd, stdin):
|
||||
self.claude_folders.append(cwd)
|
||||
return fake.effects().claude(args, cwd, stdin)
|
||||
effects = dataclasses.replace(fake.effects(), now=lambda: clock[0], claude=claude)
|
||||
with tempfile.TemporaryDirectory() as folder, contextlib.redirect_stdout(io.StringIO()) as said, contextlib.redirect_stderr(io.StringIO()) as failed:
|
||||
archive = archive or pathlib.Path(folder, "transcripts", "project")
|
||||
worker.run_worker("/r", [], {}, archive, RUNG, effects)
|
||||
@@ -48,6 +52,7 @@ class StuckWorkers(unittest.TestCase):
|
||||
[(args, prompt)] = fake.made("claude")
|
||||
self.assertEqual(args[args.index("--model") + 1 :][:3], ["claude-opus-5-5", "--effort", "medium"])
|
||||
self.assertEqual(args[args.index("--tools") + 1 :][:2], ["", "--strict-mcp-config"])
|
||||
self.assertEqual(self.claude_folders, ["/r"])
|
||||
self.assertEqual(json.loads(args[args.index("--json-schema") + 1])["properties"]["verdict"]["enum"], ["working", "waiting on a person", "stuck"])
|
||||
self.assertTrue(prompt.endswith("\n\nShell 7: bin/run-tests\nIts processes, as pid, state, CPU and command line:\n8 S 2.0 s python3 -m pytest\n9 S 0.0 s sh -c trap '' INT; sleep 999\nThe end of its output:\ncollected 40 items"))
|
||||
line = "stuck check: a headless claude judged the worker stuck, naming process 8 (python3 -m pytest): pytest waits on a shell that ignores SIGINT" + sign(1600, 1600)
|
||||
|
||||
@@ -58,7 +58,7 @@ class TheCall(unittest.TestCase):
|
||||
def test_names_the_scoring_where_claude_fails(self) -> None:
|
||||
failed = self.ask(Claude("", 1))
|
||||
assert isinstance(failed, Failure), failed
|
||||
self.assertIn("the scoring", failed.reason)
|
||||
self.assertEqual(failed.reason, "the scoring exited 1")
|
||||
|
||||
def test_puts_the_rule_the_goals_the_language_and_the_item_in_the_prompt(self) -> None:
|
||||
text = prompt(ISSUE, "L is the chance of a defect.", "An item moves only these: `epic 1`.", "Swedish")
|
||||
|
||||
Reference in New Issue
Block a user