Kill the mutants of the evidence separator and the CPU sum

This commit is contained in:
2026-11-19 09:16:14 +01:00
parent a12710ebc4
commit d251d50472
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -57,7 +57,8 @@ class StuckWorkers(unittest.TestCase):
def test_a_shell_older_than_a_chunk_usually_runs_is_investigated_at_the_first_check(self):
old = [shell(pid, started=NOW - stuck_workers.OLD, written=NOW + 290) for pid in (7, 10)]
_, fake, said, _, _ = self.worker_with(ASSISTANT, None, held=old, replies=[verdict("working", 7, "the tests still print")])
self.assertEqual(len(fake.made("claude")), 1)
[(_, prompt)] = fake.made("claude")
self.assertIn("collected 40 items\n\nShell 10: bin/run-tests\n", prompt)
self.assertIn(f"stuck check: shell 7 has run {stuck_workers.OLD + 300} s, written nothing for 10 s: bin/run-tests; shell 10 has run {stuck_workers.OLD + 300} s, written nothing for 10 s: bin/run-tests; a headless claude judged the worker working, held by process 7: the tests still print", said)
def test_a_worker_whose_shells_show_no_sign_is_not_investigated(self):
+2 -1
View File
@@ -210,7 +210,8 @@ class ChildShells(unittest.TestCase):
time.sleep(1)
used = self.shell_of(busy).cpu - before
self.assertGreater(used, 0.2 * (time.monotonic() - started))
self.assertLess(used, 1.5 * (time.monotonic() - started))
# Under 2 × the kernel's share alone, so a sum that counts one mode twice fails.
self.assertLess(used, 1.15 * (time.monotonic() - started))
processes = self.shell_of(busy).processes
self.assertEqual([line.split(" ", 4)[4] for line in processes], ["dd if=/dev/zero of=/dev/null bs=1M", "sleep 60"])
self.assertEqual([line.split(" ")[1] for line in processes], ["R", "S"])