Skip to content

Commit

Permalink
Skip concurrent threaded test on jruby (#2415)
Browse files Browse the repository at this point in the history
  • Loading branch information
sl0thentr0py authored Sep 23, 2024
1 parent 246e926 commit 0c875e4
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,33 +69,35 @@
end

# see https://github.com/getsentry/sentry-ruby/issues/1858
it "noops on thread with cloned hub" do
mutex = Mutex.new
cv = ConditionVariable.new

a = Thread.new do
expect(Sentry.get_current_hub).to be_a(Sentry::Hub)
unless RUBY_PLATFORM == "java"
it "noops on thread with cloned hub" do
mutex = Mutex.new
cv = ConditionVariable.new

a = Thread.new do
expect(Sentry.get_current_hub).to be_a(Sentry::Hub)

# close in another thread
b = Thread.new do
mutex.synchronize do
Sentry.close
cv.signal
end
end

# close in another thread
b = Thread.new do
mutex.synchronize do
Sentry.close
cv.signal
end
end
# wait for other thread to close SDK
cv.wait(mutex)

mutex.synchronize do
# wait for other thread to close SDK
cv.wait(mutex)
expect(Sentry).not_to receive(:add_breadcrumb)
logger.info("foo")
end

expect(Sentry).not_to receive(:add_breadcrumb)
logger.info("foo")
b.join
end

b.join
a.join
end

a.join
end
end
end

0 comments on commit 0c875e4

Please sign in to comment.