Make concurrency verification deterministic and exhaustive

This commit is contained in:
ms2k 2026-07-22 01:51:55 +09:00
commit 84bb22a7db

View file

@ -330,6 +330,7 @@ class VerificationTests(unittest.TestCase):
"lazaret-ignored-workspace",
"lazaret-launch-wrapper",
"lazaret-runtime-supervisor",
"lazaret-sandbox-init",
"lazaret-workspace-benchmark",
},
)
@ -426,7 +427,9 @@ class VerificationTests(unittest.TestCase):
"--filterset",
(
"not binary(capability-drop-helper) and not binary(acquisition) "
"and not binary(recovery-process) and not binary(runtime-composition) "
"and not binary(state-anchor-lifecycle) and not binary(recovery-process) "
"and not binary(runtime-composition) and not binary(escalation) "
"and not binary(prepared-worker) "
"and not binary(network-runtime)"
),
],
@ -440,6 +443,16 @@ class VerificationTests(unittest.TestCase):
"acquisition",
"--locked",
],
[
"cargo",
"test",
"--offline",
"-p",
"lazaret-state-anchor",
"--test",
"state-anchor-lifecycle",
"--locked",
],
[
"cargo",
"test",
@ -460,6 +473,26 @@ class VerificationTests(unittest.TestCase):
"capability-drop-helper",
"--locked",
],
[
"cargo",
"test",
"--offline",
"-p",
"lazaret-host-coordinator",
"--test",
"escalation",
"--locked",
],
[
"cargo",
"test",
"--offline",
"-p",
"lazaret-host-coordinator",
"--test",
"prepared-worker",
"--locked",
],
[
"cargo",
"test",
@ -505,6 +538,36 @@ class VerificationTests(unittest.TestCase):
self.assertIn("exact uv 0.11.28", source)
self.assertIn("Python 3.11 or newer", source)
def test_every_harnessless_fixture_is_excluded_and_run_explicitly(self) -> None:
harnessless = set()
for manifest_path in (ROOT / "crates").glob("*/Cargo.toml"):
manifest = VERIFY.load_toml(manifest_path)
package = manifest["package"]["name"]
for target in manifest.get("test", []):
if target.get("harness") is False:
harnessless.add((package, target["name"]))
nextest_filter = VERIFY.NEXTEST_COMMAND[-1]
for _, target in harnessless:
self.assertIn(f"not binary({target})", nextest_filter)
commands = []
original_run = VERIFY.run
original_physical = VERIFY.run_physical
VERIFY.run = lambda command, cwd=VERIFY.ROOT: commands.append(command)
VERIFY.run_physical = lambda command, cwd=VERIFY.ROOT: commands.append(command)
try:
VERIFY.run_rust_tests()
finally:
VERIFY.run = original_run
VERIFY.run_physical = original_physical
explicit = {
(command[command.index("-p") + 1], command[command.index("--test") + 1])
for command in commands
if "-p" in command and "--test" in command
}
self.assertEqual(explicit, harnessless)
def test_physical_test_accepts_only_pass_or_explicit_skip(self) -> None:
with mock.patch.object(
VERIFY.subprocess,