From dce8c2ae9dc7075347bc05c3855b22c62d6717d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Thu, 18 Jan 2018 18:21:35 +0100 Subject: [PATCH] Fix memcached 1.5.4 test compatibility. --- ....6-Fix-memcached-1.5.4-compatibility.patch | 44 +++++++++++++++++++ rubygem-dalli.spec | 9 +++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 rubygem-dalli-2.7.6-Fix-memcached-1.5.4-compatibility.patch diff --git a/rubygem-dalli-2.7.6-Fix-memcached-1.5.4-compatibility.patch b/rubygem-dalli-2.7.6-Fix-memcached-1.5.4-compatibility.patch new file mode 100644 index 0000000..0b0302d --- /dev/null +++ b/rubygem-dalli-2.7.6-Fix-memcached-1.5.4-compatibility.patch @@ -0,0 +1,44 @@ +From 754414d3cd21a385ea62d58307ed7055e1df2996 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Thu, 18 Jan 2018 17:10:50 +0100 +Subject: [PATCH] Fix mamcached 1.5.4 compatibility. + +memcached 1.5.4 changed order of evaluation of command line parameters +[1]. As a result, the test suite failed with errors such as: + +~~~ +$ ruby -Ilib:test -e 'Dir.glob('\''./test/test_*.rb'\'').sort.each{ |x| require x }' +Testing with Rails 5.1.4 +Using standard socket IO (ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]) +Run options: --seed 35324 + # Running: +Found memcached 1.5.4 in PATH +.........................................................Cannot set item size limit higher than 1/2 of memory max. +Cannot set item size limit higher than 1/2 of memory max. +F +Failure: +Dalli::using a live server::in low memory conditions#test_0001_handle error response correctly [/builddir/build/BUILD/dalli-2.7.6/usr/share/gems/gems/dalli-2.7.6/test/test_dalli.rb:740]: +unexpected failure on iteration 0 +/usr/share/gems/gems/railties-5.1.4/lib/rails/test_unit/reporter.rb:70:in `method': undefined method `test_0001_handle error response correctly' for class `Minitest::Result' (NameError) +~~~ + +This commit adjust the memcached parameters to make the test suite pass. + +[1] https://github.com/memcached/memcached/commit/95246f7947e9d95969d04db0898a93ef66235fb0 +--- + test/memcached_mock.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/memcached_mock.rb b/test/memcached_mock.rb +index 47e96cb..42ba9d7 100644 +--- a/test/memcached_mock.rb ++++ b/test/memcached_mock.rb +@@ -108,7 +108,7 @@ def memcached_cas_persistent(port = 25662) + + + def memcached_low_mem_persistent(port = 19128) +- dc = start_and_flush_with_retry(port, '-m 1 -M') ++ dc = start_and_flush_with_retry(port, '-m 1 -M -I 512k') + yield dc, port if block_given? + end + diff --git a/rubygem-dalli.spec b/rubygem-dalli.spec index b23a9a1..a7e5a69 100644 --- a/rubygem-dalli.spec +++ b/rubygem-dalli.spec @@ -5,7 +5,7 @@ Name: rubygem-%{gem_name} Version: 2.7.6 -Release: 3%{?dist} +Release: 4%{?dist} Summary: High performance memcached client for Ruby License: MIT URL: https://github.com/petergoldstein/dalli @@ -17,6 +17,9 @@ Source1: %{gem_name}-%{version}-tests.tgz # Use 'assert_nil ...' instead of 'assert_equal nil, ...' # https://github.com/petergoldstein/dalli/pull/661 Patch0: rubygem-dalli-2.7.6-Use-assert_nil-in-tests.patch +# Fix memcached 1.5.4 test compatibility. +# https://github.com/petergoldstein/dalli/pull/672 +Patch1: rubygem-dalli-2.7.6-Fix-memcached-1.5.4-compatibility.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel @@ -63,6 +66,7 @@ cp -pa .%{gem_dir}/* \ pushd .%{gem_instdir} tar xzvf %{SOURCE1} cat %{PATCH0} | patch -p1 +cat %{PATCH1} | patch -p1 sed -i '/bundler/ s/^/#/' test/helper.rb ruby -Ilib:test -e "Dir.glob('./test/test_*.rb').sort.each{ |x| require x }" popd @@ -82,6 +86,9 @@ popd %{gem_instdir}/Gemfile %changelog +* Thu Jan 18 2018 Vít Ondruch - 2.7.6-4 +- Fix memcached 1.5.4 test compatibility. + * Wed Aug 30 2017 Pavel Valena - 2.7.6-3 - Fix FTBFS(tests only) in rawhide.