diff --git a/examples/folio/gates-testdata/g2-benign-only/output.log b/examples/folio/gates-testdata/g2-benign-only/output.log index e628145..9403538 100644 --- a/examples/folio/gates-testdata/g2-benign-only/output.log +++ b/examples/folio/gates-testdata/g2-benign-only/output.log @@ -1,4 +1,5 @@ companion pid=4242 listening on 127.0.0.1:51000 objc[4242]: Class FBSDKError is implemented in both /a (0x1) and /b (0x2). One of the two will be used. Which one is undefined. WARNING: All log messages before absl::InitializeLog() is called are written to STDERR +archived previous runs under runs/ERRORS_archive run complete diff --git a/examples/folio/gates-testdata/g2-real-error/output.log b/examples/folio/gates-testdata/g2-real-error/output.log index b8c34fa..6fb91f1 100644 --- a/examples/folio/gates-testdata/g2-real-error/output.log +++ b/examples/folio/gates-testdata/g2-real-error/output.log @@ -1,4 +1,5 @@ companion pid=4242 listening on 127.0.0.1:51000 objc[4242]: Class FBSDKError is implemented in both /a (0x1) and /b (0x2). One of the two will be used. Which one is undefined. WARNING: All log messages before absl::InitializeLog() is called are written to STDERR +archived previous runs under runs/ERRORS_archive error: hierarchy fetch failed: companion connection lost diff --git a/examples/folio/gates-testdata/generate.py b/examples/folio/gates-testdata/generate.py index 826fe01..2132ce3 100644 --- a/examples/folio/gates-testdata/generate.py +++ b/examples/folio/gates-testdata/generate.py @@ -77,6 +77,9 @@ BENIGN_NOISE = [ "objc[4242]: Class FBSDKError is implemented in both /a (0x1) and /b (0x2). " "One of the two will be used. Which one is undefined.\n", "WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\n", + # An incidental ERROR substring inside a longer word: the G2 scan is + # word-bounded, so this must not trip the gate. + "archived previous runs under runs/ERRORS_archive\n", ] write_run("pass", healthy_steps()) diff --git a/examples/folio/gates.sh b/examples/folio/gates.sh index 414b300..1c1458d 100755 --- a/examples/folio/gates.sh +++ b/examples/folio/gates.sh @@ -47,8 +47,9 @@ companion_process_name="idb_companion" # only lines that are provably harmless and emitted on every healthy run. benign_stderr_substrings=( # The dynamic linker reports the same Objective-C class registered by two - # loaded images. The companion runs fine; this is cosmetic. - "objc[*]: Class" + # loaded images. The companion runs fine; this is cosmetic. The real line + # reads "objc[]: Class ...", so the fixed substring is "]: Class". + "]: Class" "is implemented in both" "One of the two will be used. Which one is undefined." # gRPC and absl emit informational banner lines on startup. @@ -59,8 +60,9 @@ benign_stderr_substrings=( # G2 helper: strip benign companion noise, then report sanderling ERROR lines. # sanderling's progress logger renders error-level records as lines beginning -# "error:" (see internal/testrun/progress.go). We also catch upper-case ERROR -# for safety against future handlers. +# "error:" (see internal/testrun/progress.go). We also catch the upper-case +# ERROR token (word-bounded, so ERRORS/ERRORLESS and path fragments do not +# trip the gate) for safety against future handlers. error_lines_in() { local output_file="$1" local filtered @@ -69,7 +71,7 @@ error_lines_in() { for pattern in "${benign_stderr_substrings[@]}"; do filtered="$(printf '%s\n' "$filtered" | grep -vF "$pattern" || true)" done - printf '%s\n' "$filtered" | grep -E '(^error:|ERROR|level=ERROR)' || true + printf '%s\n' "$filtered" | grep -E '(^error:|\bERROR\b)' || true } # G1: process exit status recorded by the runner loop.