Answer product-owner round 1: 0 🔴, 3 🟡 (0 misread); check a shell that holds a heavy slot, name the process's command, and judge each shell once

This commit is contained in:
2026-11-19 09:56:43 +01:00
parent ed241f3ab5
commit f3af8fda13
5 changed files with 75 additions and 42 deletions
+4 -4
View File
@@ -850,8 +850,8 @@ class LingeringWorkers(unittest.TestCase):
record = archive / lingering_workers.RECORD
return streamed, said.getvalue(), record.read_text() if record.exists() else ""
def shell(self, written=NOW - 1000, runs_busy_tool=False):
return Shell(pid=7, started=NOW - 1000, command="until false; do sleep 15; done", written=written, runs_busy_tool=runs_busy_tool)
def shell(self, written=NOW - 1000, runs_busy_tool=False, holds_slot=False):
return Shell(pid=7, started=NOW - 1000, command="until false; do sleep 15; done", written=written, runs_busy_tool=runs_busy_tool, holds_slot=holds_slot)
def test_a_worker_that_lingers_after_its_result_loses_its_quiet_shell_and_the_stop_is_said_and_recorded_in_utc(self):
shell = self.shell()
@@ -867,8 +867,8 @@ class LingeringWorkers(unittest.TestCase):
streamed, said, record = self.worker_with(*events, held=[self.shell()])
self.assertEqual((streamed.stopped, said, record), ([], "", ""))
def test_a_worker_keeps_every_shell_while_one_of_them_writes_output_or_runs_a_busy_tool(self):
for busy in (self.shell(written=NOW + 200), self.shell(runs_busy_tool=True)):
def test_a_worker_keeps_every_shell_while_one_of_them_writes_output_runs_a_busy_tool_or_holds_a_heavy_slot(self):
for busy in (self.shell(written=NOW + 200), self.shell(runs_busy_tool=True), self.shell(holds_slot=True)):
with self.subTest(busy=busy):
streamed, _, _ = self.worker_with(self.RESULT, None, held=[self.shell(), busy])
self.assertEqual(streamed.stopped, [])