From 28424e6b85a35bb587116afc4fd00c1aff81fe1c Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Tue, 29 Jul 2025 14:12:10 +0000 Subject: [PATCH 1/3] Fix test failures under jruby --- sentry-ruby/spec/sentry/client_spec.rb | 6 +++--- sentry-ruby/spec/sentry/vernier/profiler_spec.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sentry-ruby/spec/sentry/client_spec.rb b/sentry-ruby/spec/sentry/client_spec.rb index a87e81fea..47c047e53 100644 --- a/sentry-ruby/spec/sentry/client_spec.rb +++ b/sentry-ruby/spec/sentry/client_spec.rb @@ -321,15 +321,15 @@ def sentry_context version = Gem::Version.new(RUBY_VERSION) case - when version >= Gem::Version.new("3.4.0-dev") + when version >= Gem::Version.new("3.4.0-dev") && RUBY_ENGINE == "ruby" expect(hash[:exception][:values][0][:value]).to eq( "undefined method '[]' for nil (NoMethodError)\n\n {}[:foo][:bar]\n ^^^^^^" ) - when version >= Gem::Version.new("3.3.0-dev") + when version >= Gem::Version.new("3.3.0-dev") && RUBY_ENGINE == "ruby" expect(hash[:exception][:values][0][:value]).to eq( "undefined method `[]' for nil (NoMethodError)\n\n {}[:foo][:bar]\n ^^^^^^" ) - when version >= Gem::Version.new("3.2") + when version >= Gem::Version.new("3.2") && RUBY_ENGINE == "ruby" expect(hash[:exception][:values][0][:value]).to eq( "undefined method `[]' for nil:NilClass (NoMethodError)\n\n {}[:foo][:bar]\n ^^^^^^" ) diff --git a/sentry-ruby/spec/sentry/vernier/profiler_spec.rb b/sentry-ruby/spec/sentry/vernier/profiler_spec.rb index 7b0398a66..b8ef3a105 100644 --- a/sentry-ruby/spec/sentry/vernier/profiler_spec.rb +++ b/sentry-ruby/spec/sentry/vernier/profiler_spec.rb @@ -2,7 +2,7 @@ require "sentry/vernier/profiler" -RSpec.describe Sentry::Vernier::Profiler, when: { ruby_version?: [:>=, "3.3"] } do +RSpec.describe Sentry::Vernier::Profiler, when: { ruby_version?: [:>=, "3.3"], ruby_engine?: "ruby" } do subject(:profiler) { described_class.new(Sentry.configuration) } before do @@ -264,7 +264,7 @@ expect(thread2[:name]).to eq("thread-bar-1") end - it 'has correct frames', when: { ruby_version?: [:>=, "3.3"] } do + it 'has correct frames', when: { ruby_version?: [:>=, "3.3"], ruby_engine?: "ruby" } do frames = profiler.to_hash[:profile][:frames] foo_frame = frames.find { |f| f[:function] =~ /foo/ } @@ -277,7 +277,7 @@ expect(foo_frame[:abs_path]).to include('sentry-ruby/spec/support/profiler.rb') end - it 'has correct stacks', when: { ruby_version?: [:>=, "3.3"] } do + it 'has correct stacks', when: { ruby_version?: [:>=, "3.3"], ruby_engine?: "ruby" } do profile = profiler.to_hash[:profile] frames = profile[:frames] stacks = profile[:stacks] From 9c6d6ab95e98e17a425126366e6e3d3cbd0badfc Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Tue, 29 Jul 2025 20:16:06 +0000 Subject: [PATCH 2/3] Fix flaky thread interface spec --- sentry-ruby/spec/sentry/client_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sentry-ruby/spec/sentry/client_spec.rb b/sentry-ruby/spec/sentry/client_spec.rb index 47c047e53..f455f6ca6 100644 --- a/sentry-ruby/spec/sentry/client_spec.rb +++ b/sentry-ruby/spec/sentry/client_spec.rb @@ -201,10 +201,10 @@ def sentry_context event = nil t = Thread.new do + Thread.current.name = "Thread 1" event = subject.event_from_message(message) end - t.name = "Thread 1" t.join hash = event.to_hash @@ -365,10 +365,10 @@ def detailed_message(*) event = nil t = Thread.new do + Thread.current.name = "Thread 1" event = subject.event_from_exception(exception) end - t.name = "Thread 1" t.join event_hash = event.to_hash From 1aa874a736ec246e98518523a6dddcb4aa1abac1 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Tue, 29 Jul 2025 20:37:45 +0000 Subject: [PATCH 3/3] Remove jruby/rails-6.1 from matrix jruby is now 3.4 and that version no longer works with rails 6.x furthermore, jruby is not yet compatible with rails 7.1 and 8.0. --- .github/workflows/sentry_rails_test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/sentry_rails_test.yml b/.github/workflows/sentry_rails_test.yml index 306cef080..3084ff8e4 100644 --- a/.github/workflows/sentry_rails_test.yml +++ b/.github/workflows/sentry_rails_test.yml @@ -81,8 +81,6 @@ jobs: rails_version: "8.0.0" - ruby_version: "3.4" rails_version: "8.0.0" - - ruby_version: "jruby" - rails_version: 6.1.0 - ruby_version: "3.2" rails_version: 7.1.0 options: