Skip to content

Commit 17936d4

Browse files
Isolate the child Ruby in test_settings_without_ractor
Ruby loads error_highlight at boot unless it is disabled, so the child process loaded it before the script hid Ractor and took the Ractor branch. It only passed where RUBYOPT had --disable-error_highlight, and failed in CI, where bundle exec also adds -rbundler/setup to RUBYOPT. Run the child with --disable-gems and without RUBYOPT.
1 parent e1e0b2d commit 17936d4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎test/test_error_highlight.rb‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1864,7 +1864,9 @@ def test_settings_without_ractor
18641864
ErrorHighlight::DefaultFormatter.max_snippet_width = nil
18651865
p ErrorHighlight.formatter, ErrorHighlight::DefaultFormatter.max_snippet_width
18661866
RUBY
1867-
out = IO.popen([RbConfig.ruby, "-I", lib, "-e", script], err: [:child, :out], &:read)
1867+
# Ruby loads error_highlight at boot (before the script hides Ractor) unless
1868+
# gems are disabled, and RUBYOPT could re-enable it or load bundler/setup.
1869+
out = IO.popen({ "RUBYOPT" => nil }, [RbConfig.ruby, "--disable-gems", "-I", lib, "-e", script], err: [:child, :out], &:read)
18681870
assert_equal(<<~END, out)
18691871
true
18701872
[true, 40]

0 commit comments

Comments
 (0)