From bdf3de60053f4b8ad601dd928d3d34102a1ba4a6 Mon Sep 17 00:00:00 2001 From: Austin Wang Date: Wed, 4 Nov 2026 08:01:08 -0800 Subject: [PATCH] ci(test_reds): a Swift Testing line after a zero-width space still counts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Swift Testing sometimes prints U+200B before an event line that follows interleaved app output. SUITE_STARTED and SUITE_ENDED are anchored, so '​✔ Suite "x" passed' never matched. gh-merge-green then called a passing suite cut short and refused to excuse a base red on https://github.com/manaflow-ai/cmux/pull/35296 (app-host shard 2). lines_of now strips the leading zero-width space. Co-Authored-By: Claude Opus 5.5 --- scripts/ci/test_reds.py | 5 ++++- tests/test_test_reds.py | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/ci/test_reds.py b/scripts/ci/test_reds.py index 93e7dbe8207d..6ea8f4da42c9 100644 --- a/scripts/ci/test_reds.py +++ b/scripts/ci/test_reds.py @@ -135,7 +135,10 @@ def __init__(self, own: bool, reasons: list, shared: list = ()): def lines_of(log: str) -> list[str]: - return [STAMP.sub("", ANSI.sub("", line)).rstrip() for line in log.splitlines()] + # Swift Testing prefixes some event lines with a zero-width space (U+200B) when another writer's output + # shares the stream ("\u200b✔ Suite \"x\" passed"); left in, the anchored suite patterns miss the line and + # a suite that passed reads as never finished (https://github.com/manaflow-ai/cmux/pull/35296). + return [STAMP.sub("", ANSI.sub("", line)).lstrip("\u200b").rstrip() for line in log.splitlines()] def _words(text: str, words: list[str]) -> None: diff --git a/tests/test_test_reds.py b/tests/test_test_reds.py index 2849bc29993a..94310a8bd5ef 100644 --- a/tests/test_test_reds.py +++ b/tests/test_test_reds.py @@ -110,6 +110,14 @@ def test_a_whole_parameterized_run_is_not_cut_off(self): "✘ Test a() failed after 0.1 seconds with 1 issue.", SUMMARY) self.assertEqual(reds.read(whole).truncated, []) + def test_a_suite_end_after_a_zero_width_space_is_whole(self): + # PR 35296's app-host shard 2: Swift Testing printed "\u200b✔ Suite ... passed" after interleaved app logs. + whole = log('◇ Suite "Cloud sidebar recorded interaction" started.', + '\u200b✔ Suite "Cloud sidebar recorded interaction" passed after 0.001 seconds.', SUMMARY) + self.assertEqual(reds.read(whole).truncated, []) + cut = log('\u200b◇ Suite "s" started.', SUMMARY) + self.assertIn('1 suite(s) started and never finished: "s"', reds.read(cut).truncated) + def test_a_run_cut_off_between_tests_is_the_heads_own(self): cut = log("◇ Test run started.", "◇ Suite S started.", "◇ Test a() started.", failed("a()"), "✘ Test a() failed after 0.1 seconds with 1 issue.")