From 6c38a6c15bd6065ad4455c381ca463902d14dfba Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 30 Mar 2026 09:44:38 -0700 Subject: [PATCH] Scrub invalid UTF-8 bytes from debuggee output in tests setup_remote_debuggee reads lines from PTY and matches them against regexps, but Regexp#=== raises ArgumentError when the line contains invalid UTF-8 byte sequences. This has been causing random CI failures: https://github.com/ruby/ruby/actions/runs/23754369209/job/69204936437 Use String#scrub to replace invalid bytes before matching. --- test/support/test_case.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/support/test_case.rb b/test/support/test_case.rb index 8ae965372..9797975f2 100644 --- a/test/support/test_case.rb +++ b/test/support/test_case.rb @@ -173,6 +173,7 @@ def setup_remote_debuggee(cmd) Timeout.timeout(TIMEOUT_SEC) do line = remote_info.r.gets + line = line.scrub if line remote_info.debuggee_backlog << line # wait for two lines (order is unstable)