Skip to content

Conversation

@solnic
Copy link
Collaborator

@solnic solnic commented Sep 25, 2025

This updates sidekiq spec setup to be inline with other projects by adding spec:isolated group and moving rails_spec.rb there because it is meant to be run in isolation where sentry-rails is required.

While working on this I also discovered that there's spec flakiness here due to the fact that redis patch is enabled by default and spec require order would make some specs randomly fail under Sidekiq <= 6.5. I fixed it by removing redis from default patches in the test config but I am wondering why this patch is enabled be default?

#skip-changelog

@dingsdax dingsdax self-requested a review September 26, 2025 09:15
@dingsdax dingsdax requested review from sl0thentr0py and removed request for dingsdax October 20, 2025 14:06
@solnic solnic force-pushed the sidekiq-better-rails-specs branch 3 times, most recently from c605a1f to f88a5bb Compare October 28, 2025 11:09
@codecov
Copy link

codecov bot commented Oct 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.28%. Comparing base (36de35d) to head (ffb555e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2723   +/-   ##
=======================================
  Coverage   90.28%   90.28%           
=======================================
  Files         131      131           
  Lines        5258     5258           
=======================================
  Hits         4747     4747           
  Misses        511      511           
Components Coverage Δ
sentry-ruby 97.60% <ø> (ø)
sentry-rails 55.34% <ø> (ø)
sentry-sidekiq 95.05% <ø> (ø)
sentry-resque 94.44% <ø> (ø)
sentry-delayed_job 94.68% <ø> (ø)
sentry-opentelemetry 99.31% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@solnic solnic marked this pull request as ready for review October 28, 2025 11:21
@sl0thentr0py
Copy link
Member

sl0thentr0py commented Oct 30, 2025

We generally default enable integrations that are widely used. Sentry SDK design is not opt-in in most cases.

What errors specifically does the patch cause?

@solnic solnic force-pushed the sidekiq-better-rails-specs branch from f88a5bb to 7efa6bc Compare November 4, 2025 15:06
cursor[bot]

This comment was marked as outdated.

@solnic
Copy link
Collaborator Author

solnic commented Nov 4, 2025

We generally default enable integrations that are widely used. Sentry SDK design is not opt-in in most cases.

What errors specifically does the patch cause?

@sl0thentr0py see recent commit. Basically after moving the conditional integration test to the isolated dir, for whatever reason, redis instrumentation started kicking in in specs where it previously did not, resulting in more spans in events.

@solnic solnic force-pushed the sidekiq-better-rails-specs branch from ffb555e to d54d9b5 Compare November 4, 2025 15:29

span = transport.events.last.spans.detect { |span| span[:op] == "queue.publish" }
expect(span[:op]).to eq("queue.publish")
expect(span[:data]['messaging.destination.name']).to eq('default')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Nil-check missing after detect-span lookup

This test case is missing a nil check after using detect to find a span. If no matching span is found, accessing its properties will raise a NoMethodError. This is inconsistent with other similar span checks in this file and commit.

Fix in Cursor Fix in Web

Copy link
Member

@sl0thentr0py sl0thentr0py left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty, makes sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants