Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use postponed jobs on Ruby 3.3+YJIT #219

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/stackprof.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
end

if defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?
StackProf.use_postponed_job!
if RUBY_VERSION < "3.3"
# On 3.3 we don't need postponed jobs:
# https://github.com/ruby/ruby/commit/a1dc1a3de9683daf5a543d6f618e17aabfcb8708
StackProf.use_postponed_job!
end
elsif RUBY_VERSION == "3.2.0"
# 3.2.0 crash is the signal is received at the wrong time.
# Fixed in https://github.com/ruby/ruby/pull/7116
Expand Down
2 changes: 1 addition & 1 deletion test/test_middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'minitest/autorun'
require 'tmpdir'

class StackProf::MiddlewareTest < MiniTest::Test
class StackProf::MiddlewareTest < Minitest::Test

def test_path_default
StackProf::Middleware.new(Object.new)
Expand Down
4 changes: 2 additions & 2 deletions test/test_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'stackprof'
require 'minitest/autorun'

class ReportDumpTest < MiniTest::Test
class ReportDumpTest < Minitest::Test
require 'stringio'

def test_dump_to_stdout
Expand Down Expand Up @@ -33,7 +33,7 @@ def assert_dump(expected, marshal_data)
end
end

class ReportReadTest < MiniTest::Test
class ReportReadTest < Minitest::Test
require 'pathname'

def test_from_file_read_json
Expand Down
2 changes: 1 addition & 1 deletion test/test_stackprof.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'tempfile'
require 'pathname'

class StackProfTest < MiniTest::Test
class StackProfTest < Minitest::Test
def setup
Object.new # warm some caches to avoid flakiness
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_truffleruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'minitest/autorun'

if RUBY_ENGINE == 'truffleruby'
class StackProfTruffleRubyTest < MiniTest::Test
class StackProfTruffleRubyTest < Minitest::Test
def test_error
error = assert_raises RuntimeError do
StackProf.run(mode: :cpu) do
Expand Down