From bc703c9f6f82aa966328cf48134838eb7b73170d Mon Sep 17 00:00:00 2001 From: Agent Control Runner Date: Wed, 21 Oct 2026 01:57:18 +0900 Subject: [PATCH] =?UTF-8?q?P28-01-RESTART:=20=E7=8F=BEHEAD=E3=81=AE?= =?UTF-8?q?=E6=80=A7=E8=83=BD=E5=9F=BA=E6=BA=96=EF=BC=9A=E9=80=94=E4=B8=AD?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E3=83=BB=E5=88=A5PID=E5=86=8D=E9=96=8B?= =?UTF-8?q?=E3=81=AE=E5=86=8D=E7=8F=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../p28-01/restart/probe/test_restart.py | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/plans/original-completion-2026-10-02/execution/p28-01/restart/probe/test_restart.py b/docs/plans/original-completion-2026-10-02/execution/p28-01/restart/probe/test_restart.py index cf16653..b551ad9 100644 --- a/docs/plans/original-completion-2026-10-02/execution/p28-01/restart/probe/test_restart.py +++ b/docs/plans/original-completion-2026-10-02/execution/p28-01/restart/probe/test_restart.py @@ -191,6 +191,24 @@ def synthetic_receipt(out): class RestartTests(unittest.TestCase): + @staticmethod + def here_inventory(): + return {str(path.relative_to(check.HERE)): hashlib.sha256(path.read_bytes()).hexdigest() + for path in check.HERE.rglob("*") if path.is_file()} + + @classmethod + def setUpClass(cls): + cls.inventory_before = cls.here_inventory() + + def setUp(self): + # Check after every test, including failures, independently of test order. + self.addCleanup(lambda: self.assertEqual(self.here_inventory(), self.inventory_before)) + + def test_zz_here_inventory_unchanged(self): + # unittest's default ordering places this after all twelve existing tests. + self.assertIn("test_restart.py", self.inventory_before) + self.assertEqual(self.here_inventory(), self.inventory_before) + def rejects(self, original, mutations, validator): for name, mutation in mutations.items(): with self.subTest(rejection=name): @@ -328,7 +346,7 @@ class RestartTests(unittest.TestCase): next(iterator) def test_d3_transfer_and_fresh_profiles(self): - with tempfile.TemporaryDirectory(dir=check.HERE) as temporary: + with tempfile.TemporaryDirectory(dir=os.environ.get("BUILD_OUTPUT_DIR") or None) as temporary: base = Path(temporary) source = base / "source" source.mkdir() @@ -366,7 +384,7 @@ class RestartTests(unittest.TestCase): check.check_probe(text.replace("GameClock.advance_minutes(1)", replacement)) def test_rs7_rs8_full_receipt_rejections(self): - with tempfile.TemporaryDirectory(dir=check.HERE) as temporary: + with tempfile.TemporaryDirectory(dir=os.environ.get("BUILD_OUTPUT_DIR") or None) as temporary: out = Path(temporary) receipt = synthetic_receipt(out) check.check_receipt(receipt, out) @@ -391,7 +409,7 @@ class RestartTests(unittest.TestCase): check.check_receipt(receipt, out) def test_d6_raw_report_and_audio(self): - with tempfile.TemporaryDirectory(dir=check.HERE) as temporary: + with tempfile.TemporaryDirectory(dir=os.environ.get("BUILD_OUTPUT_DIR") or None) as temporary: out = Path(temporary) receipt = synthetic_receipt(out) row = receipt["phases"][3] @@ -418,7 +436,7 @@ class RestartTests(unittest.TestCase): "time.sleep(0.15)\n" "if mode=='timeout': time.sleep(5)\n" "sys.exit(3 if mode=='exit' else 0)\n") - with tempfile.TemporaryDirectory(dir=check.HERE) as temporary: + with tempfile.TemporaryDirectory(dir=os.environ.get("BUILD_OUTPUT_DIR") or None) as temporary: base = Path(temporary) script = base / "fake-child" script.write_text(child)