Skip to content

Commit 89755ec

Browse files
committed
[GR-23507] Suppress HotSpot thread warnings on stdout, they break tests
PullRequest: truffleruby/2733
2 parents 76f856b + 2576c26 commit 89755ec

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

tool/jt.rb

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ def truffleruby?
278278
@truffleruby ||= File.executable?(truffleruby_launcher_path)
279279
end
280280

281+
def truffleruby_jvm?
282+
truffleruby? and !truffleruby_native?
283+
end
284+
285+
def jdk8?
286+
graalvm_home and !Dir.exist?("#{graalvm_home}/jmods")
287+
end
288+
281289
def truffleruby_launcher_path
282290
require_ruby_launcher!
283291
@truffleruby_launcher_path ||= File.expand_path('../truffleruby', @ruby_launcher_realpath)
@@ -869,7 +877,7 @@ def rebuild(*options)
869877
when '--no-core-load-path'
870878
core_load_path = false
871879
when '--reveal'
872-
vm_args += %w[--vm.ea --vm.esa] unless truffleruby_native?
880+
vm_args += %w[--vm.ea --vm.esa] if truffleruby_jvm?
873881
when '--check-compilation'
874882
add_experimental_options.call
875883
vm_args << '--engine.CompilationFailureAction=ExitVM'
@@ -889,7 +897,7 @@ def rebuild(*options)
889897
add_experimental_options.call
890898
vm_args << '--exceptions-print-uncaught-java=true'
891899
when '--infopoints'
892-
unless truffleruby_native?
900+
if truffleruby_jvm?
893901
vm_args << '--vm.XX:+UnlockDiagnosticVMOptions' << '--vm.XX:+DebugNonSafepoints'
894902
end
895903
vm_args << '--engine.NodeSourcePositions=true'
@@ -915,11 +923,15 @@ def rebuild(*options)
915923
end
916924
end
917925

918-
if core_load_path && truffleruby? && !truffleruby_native?
926+
if core_load_path and truffleruby_jvm?
919927
add_experimental_options.call
920928
vm_args << "--core-load-path=#{TRUFFLERUBY_DIR}/src/main/ruby/truffleruby"
921929
end
922930

931+
if ci? and truffleruby_jvm? and !jdk8?
932+
vm_args << '--vm.Xlog:os+thread=off' # GR-23507: prevent thread warnings on stdout to break specs/tests
933+
end
934+
923935
[vm_args, ruby_args + args, options]
924936
end
925937

@@ -1509,7 +1521,7 @@ def mspec(*args)
15091521

15101522
vm_args, ruby_args, parsed_options = ruby_options({}, ['--reveal', *ruby_args])
15111523
vm_args << (truffleruby_native? ? '--vm.Xmx3G' : '--vm.Xmx2G')
1512-
vm_args << '--polyglot' unless truffleruby_native?
1524+
vm_args << '--polyglot' if truffleruby_jvm?
15131525
# Until pattern matching is complete, we enable it in specs but not globally
15141526
vm_args << '--experimental-options' << '--pattern-matching'
15151527

0 commit comments

Comments
 (0)