From 4aab9b5f8c0cccade5a5909ccce802a17ca6c2f0 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 7 Sep 2024 11:53:47 +0100 Subject: [PATCH] Pend spec broken on JRuby --- spec/rspec/support_spec.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/spec/rspec/support_spec.rb b/spec/rspec/support_spec.rb index 5d67c4d4..156b1df1 100644 --- a/spec/rspec/support_spec.rb +++ b/spec/rspec/support_spec.rb @@ -196,7 +196,20 @@ def object.some_method end if defined?(Fiber) && RUBY_VERSION.to_f >= 2.0 - it "shares data across fibres" do + broken_on_jruby = + if RSpec::Support::Ruby.jruby? + "As Fibre.new creates a new thread on JRuby this is currently " \ + "broken. There are alternative implementations that do work but " \ + "they cause issues for mocks, so given this is a minor edge case " \ + "and thread data is already broken, its acceptable. Pending " \ + "because future JRuby may fix this. see: "\ + "https://github.com/jruby/jruby/issues/1806 and " \ + "https://github.com/rspec/rspec-support/pull/610" + else + false + end + + it "shares data across fibres", pending: broken_on_jruby do RSpec::Support.thread_local_data[:__for_test] = :oh_hai Fiber.new do