Skip to content

Commit 2897eda

Browse files
committed
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.
1 parent bad4d38 commit 2897eda

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/support/test_case.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ def setup_remote_debuggee(cmd)
173173

174174
Timeout.timeout(TIMEOUT_SEC) do
175175
line = remote_info.r.gets
176+
line = line.scrub if line
176177
remote_info.debuggee_backlog << line
177178

178179
# wait for two lines (order is unstable)

0 commit comments

Comments
 (0)