fix: assert global error presence for fault-mixed soak scenarios

This commit is contained in:
2026-07-21 04:22:04 -04:00
parent 3f7a0ecebb
commit aecc5fa216
3 changed files with 22 additions and 5 deletions
+9
View File
@@ -242,3 +242,12 @@ class TestLiveInvariantsAndCaps:
inv_fault_errors_present(rows, fault_source_names=[]) # 未配故障源直接通过
with pytest.raises(AssertionError):
inv_fault_errors_present([_row("c")], fault_source_names=["bad_1"])
class TestAnyErrors:
def test_presence_and_absence(self):
from tools.soak.scoreboard import inv_any_errors
inv_any_errors([_row("a", error="TransientError: x"), _row("b")])
with pytest.raises(AssertionError, match="故障未生效"):
inv_any_errors([_row("c")])