fix: start core_probe one way from every probe

pack_probe and region_check run core_probe through probes.host.run_when_idle:
a busy refusal is retried until the wait runs out, a timeout kills the
run's whole process group, and pack_probe takes core_probe's own probe
lock, which honours RETROBIOS_PROBE_LOCK_HELD. core_probe names its busy
exit status EXIT_BUSY.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 06:04:23 +01:00
1 parent 922d60807f
commit d2984bc466
7 files changed
+49 -60

No files matched your search

+7 -4
View File
@@ -16,6 +16,7 @@ import tests
import contextlib
import io
import json
import os
import re
import shutil
import unittest
@@ -283,8 +284,9 @@ class Lock(unittest.TestCase):
return subprocess.CompletedProcess(command, 2, "", "refused")
lay = layout({"a.bin": 1})
with unittest.mock.patch.object(packprobe, "PROBE_LOCK", lock), \
unittest.mock.patch.object(packprobe.subprocess, "run", fake_run):
env = {"RETROBIOS_PROBE_LOCK": str(lock), "RETROBIOS_PROBE_LOCK_HELD": ""}
with unittest.mock.patch.dict(os.environ, env), \
unittest.mock.patch.object(packprobe, "run_group", fake_run):
for _ in range(2):
self.assertEqual(packprobe.core_probe(["run"], {"a.bin"}, lay, work), (2, None, "refused"))
self.assertEqual(held, [True, True])
@@ -314,8 +316,9 @@ class RecordsNameNoLocalPath(unittest.TestCase):
def fake_run(command, **kwargs):
return subprocess.CompletedProcess(command, 1, "", f' File "{script}", line 9\n')
with unittest.mock.patch.object(packprobe, "PROBE_LOCK", work / "probe.lock"), \
unittest.mock.patch.object(packprobe.subprocess, "run", fake_run):
env = {"RETROBIOS_PROBE_LOCK": str(work / "probe.lock"), "RETROBIOS_PROBE_LOCK_HELD": ""}
with unittest.mock.patch.dict(os.environ, env), \
unittest.mock.patch.object(packprobe, "run_group", fake_run):
code, record, error = packprobe.core_probe(["run"], set(), layout({}), work)
self.assertEqual((code, record), (1, None))
self.assertEqual(error, 'File "<repo>/scripts/core_probe.py", line 9')