Skip to content

Commit f9d0a78

Browse files
committed
[GR-44103] Ignore JVM thread warnings on stdout to break launcher spec
PullRequest: truffleruby/3637
2 parents bc50120 + bada575 commit f9d0a78

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spec/truffle/launcher_spec.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
ENV['GEM_HOME'] = nil
4545
@stderr = tmp("stderr")
4646
@redirect = "2>#{@stderr}"
47+
48+
# GR-23507, GR-44103: prevent thread warnings on stdout to break specs/tests
49+
@ignore_jvm_thread_warnings = '--vm.Xlog:os+thread=off'
4750
end
4851

4952
after :each do
@@ -433,7 +436,7 @@ def should_print_full_java_command(options, env: {})
433436

434437
['RUBYOPT', 'TRUFFLERUBYOPT'].each do |var|
435438
it "should recognize ruby --vm options in #{var} when switching to JVM" do
436-
env = { var => "--jvm --vm.Dfoo=bar" } # ignoring the original value of RUBYOPT/TRUFFLERUBYOPT on purpose here
439+
env = { var => "--jvm #{@ignore_jvm_thread_warnings} --vm.Dfoo=bar" } # ignoring the original value of RUBYOPT/TRUFFLERUBYOPT on purpose here
437440
out = ruby_exe('puts RUBY_DESCRIPTION; puts Truffle::System.get_java_property("foo")', env: env, args: @redirect)
438441
check_status_and_empty_stderr
439442
out = out.lines.map(&:chomp)
@@ -449,7 +452,7 @@ def should_print_full_java_command(options, env: {})
449452
end
450453

451454
it "switches to JVM with --jvm as a Ruby argument" do
452-
out = ruby_exe(nil, options: "--jvm --version", args: @redirect)
455+
out = ruby_exe(nil, options: "--jvm #{@ignore_jvm_thread_warnings} --version", args: @redirect)
453456
check_status_and_empty_stderr
454457
out.should =~ /GraalVM (CE|EE) JVM/
455458
end

0 commit comments

Comments
 (0)