Skip to content

Commit

Permalink
Skip concurrent threaded test on jruby
Browse files Browse the repository at this point in the history
  • Loading branch information
sl0thentr0py committed Sep 23, 2024
1 parent 23fe6f5 commit 58a0b81
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 58a0b81

Please sign in to comment.