From 2ad2778322360988fafb674b871f0ceb00406501 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Tue, 10 Jan 2023 17:23:27 +0900 Subject: [PATCH] Backport upstrem patch for pending broken test with ruby >= 3.1.3 --- ...-support-3.12.0-pend-lock-fiber-test.patch | 28 +++++++++++++++++++ rubygem-rspec-support.spec | 10 ++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 rubygem-rspec-support-3.12.0-pend-lock-fiber-test.patch diff --git a/rubygem-rspec-support-3.12.0-pend-lock-fiber-test.patch b/rubygem-rspec-support-3.12.0-pend-lock-fiber-test.patch new file mode 100644 index 0000000..c17d173 --- /dev/null +++ b/rubygem-rspec-support-3.12.0-pend-lock-fiber-test.patch @@ -0,0 +1,28 @@ +From 02e44fa481d5061c95d5332a91bcf7143b582bc8 Mon Sep 17 00:00:00 2001 +From: Jon Rowe +Date: Sat, 10 Dec 2022 11:25:15 +1100 +Subject: [PATCH] Pend broken spec on Ruby 3.1.3, skip on CI for Ruby head + +--- + spec/rspec/support/reentrant_mutex_spec.rb | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/spec/rspec/support/reentrant_mutex_spec.rb b/spec/rspec/support/reentrant_mutex_spec.rb +index 9bef54ee..c8a41c1e 100644 +--- a/spec/rspec/support/reentrant_mutex_spec.rb ++++ b/spec/rspec/support/reentrant_mutex_spec.rb +@@ -28,7 +28,13 @@ + order.join_all + end + +- if RUBY_VERSION >= '3.0' ++ # On Ruby 3.1.3 and RUBY_HEAD the raise in this spec can ++ # bypass the `raise_error` capture and break this spec but ++ # it is not sufficient to pend it as the raise can escape to the other ++ # threads somehow therefore poisoning them so its skipped entirely. ++ # This is a temporary work around to allow green cross project builds but ++ # needs a fix. ++ if RUBY_VERSION >= '3.0' && RUBY_VERSION < '3.1.3' + it 'waits when trying to lock from another Fiber' do + mutex.synchronize do + ready = false diff --git a/rubygem-rspec-support.spec b/rubygem-rspec-support.spec index 049f146..53ad128 100644 --- a/rubygem-rspec-support.spec +++ b/rubygem-rspec-support.spec @@ -3,7 +3,7 @@ %global mainver 3.11.1 %undefine prever -%global mainrel 1 +%global mainrel 2 %global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g') %bcond_with bootstrap @@ -21,6 +21,10 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{mainver}%{?prever}.gem # %%{SOURCE2} %%{name} %%{version} Source1: rubygem-%{gem_name}-%{version}-full.tar.gz Source2: rspec-related-create-full-tarball.sh +# https://github.com/rspec/rspec-support/pull/556 +# ruby 3.2.0 / 3.1.3 changes fiber deadlock treatment +# Tweaked to make test suite flexible +Patch0: rubygem-rspec-support-3.12.0-pend-lock-fiber-test.patch # tweak regex for search path Patch100: rubygem-rspec-support-3.2.1-callerfilter-searchpath-regex.patch @@ -58,6 +62,7 @@ Documentation for %{name} %setup -q -T -n %{gem_name}-%{version} -b 1 gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec +%patch0 -p1 %patch100 -p1 %build @@ -106,6 +111,9 @@ rspec spec/ || rspec --tag ~broken %doc %{gem_docdir} %changelog +* Tue Jan 10 2023 Mamoru TASAKA - 3.11.1-2 +- Backport upstrem patch for pending broken test with ruby >= 3.1.3 + * Thu Sep 15 2022 Mamoru TASAKA - 3.11.1-1 - 3.11.1