commit c6dc1b4749752cbd8732171d5114bc1a384fc3a8
parent c1cc973a5bb74c4d8808a0e6d4b054c16a563de7
Author: triesap <tyson@radroots.org>
Date: Wed, 23 Sep 2026 16:17:42 +0000
test: require the exact intended cause in trailing-output controls
Address the implementation review LOW finding: the coalesced, trailing-malformed
and unterminated-trailing controls now require the exact 'unexpected trailing
stdout' cause, and the early-EOF control requires 'early_eof', instead of
accepting alternate cause strings. 27/27 test-measurement.
Diffstat:
1 file changed, 4 insertions(+), 19 deletions(-)
diff --git a/tests/test_measurement_contract.mojo b/tests/test_measurement_contract.mojo
@@ -518,11 +518,7 @@ def test_measurement_rejects_coalesced_trailing_frame() raises:
1,
guard,
)
- assert_true(
- message.find("unexpected trailing stdout") >= 0
- or message.find("correlation_mismatch") >= 0
- or message.find("not_json") >= 0
- )
+ assert_true(message.find("unexpected trailing stdout") >= 0)
guard.assert_clean()
@@ -539,10 +535,7 @@ def test_measurement_rejects_trailing_malformed_bytes() raises:
1,
guard,
)
- assert_true(
- message.find("unexpected trailing stdout") >= 0
- or message.find("newline-terminated") >= 0
- )
+ assert_true(message.find("unexpected trailing stdout") >= 0)
guard.assert_clean()
@@ -560,10 +553,7 @@ def test_measurement_rejects_unterminated_trailing_frame() raises:
1,
guard,
)
- assert_true(
- message.find("unexpected trailing stdout") >= 0
- or message.find("newline-terminated") >= 0
- )
+ assert_true(message.find("unexpected trailing stdout") >= 0)
guard.assert_clean()
@@ -589,12 +579,7 @@ def test_measurement_rejects_early_eof_child() raises:
# EOF, not be read as a successful empty response.
var guard = CleanupGuard()
var message = _run_sh_failure("sleep 1; exit 0", 0, 1, guard)
- assert_true(message.find("measurement") >= 0)
- assert_true(
- message.find("early_eof") >= 0
- or message.find("write") >= 0
- or message.find("sampling") >= 0
- )
+ assert_true(message.find("early_eof") >= 0)
guard.assert_clean()