From 58a0b817b6dc79838785b887c4bb69a5df959b8e Mon Sep 17 00:00:00 2001 From: Neel Shah Date: Mon, 23 Sep 2024 11:46:49 -0400 Subject: [PATCH] Skip concurrent threaded test on jruby --- .../sentry/breadcrumb/sentry_logger_spec.rb | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb b/sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb index baf180922..aafcf6f96 100644 --- a/sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb +++ b/sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb @@ -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