From 470449d6a6f563eadb53df8ccf104c1c40daa1ef Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Jul 31 2013 10:35:30 +0000 Subject: Fix eunit test failure on x86_64 Signed-off-by: Peter Lemenkov --- diff --git a/erlang-riak_core-0001-Fix-rebar-deps.patch b/erlang-riak_core-0001-Fix-rebar-deps.patch index da8bb2c..102ef76 100644 --- a/erlang-riak_core-0001-Fix-rebar-deps.patch +++ b/erlang-riak_core-0001-Fix-rebar-deps.patch @@ -1,7 +1,7 @@ From 5865dfb100aac2542819d574757574c39735c64b Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 24 Mar 2013 10:46:32 +0400 -Subject: [PATCH 1/1] Fix rebar deps +Subject: [PATCH 1/2] Fix rebar deps Signed-off-by: Peter Lemenkov --- @@ -22,5 +22,5 @@ index d32b147..d09d67f 100644 {folsom, ".*", {git, "git://github.com/basho/folsom.git", {tag, "0.7.3p1"}}} ]}. -- -1.8.2.1 +1.8.3.1 diff --git a/erlang-riak_core-0002-Fix-overload-test-time-outs.patch b/erlang-riak_core-0002-Fix-overload-test-time-outs.patch new file mode 100644 index 0000000..6847fd9 --- /dev/null +++ b/erlang-riak_core-0002-Fix-overload-test-time-outs.patch @@ -0,0 +1,80 @@ +From a757c328f443bffd9e25590ebab3e1a723965175 Mon Sep 17 00:00:00 2001 +From: "Engel A. Sanchez" +Date: Tue, 28 May 2013 10:25:41 -0400 +Subject: [PATCH 2/2] Fix overload test time outs + +Testing slow vnodes tends to time out, so upping the eunit timeout +values. +The gen:call was timing out with its 5 second default instead of obeying +the eunit test timeout, so it was changed to infinity. +--- + src/riak_core_vnode_proxy.erl | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/riak_core_vnode_proxy.erl b/src/riak_core_vnode_proxy.erl +index 3091149..1948345 100644 +--- a/src/riak_core_vnode_proxy.erl ++++ b/src/riak_core_vnode_proxy.erl +@@ -336,7 +336,7 @@ fake_loop_block() -> + end. + + overload_test_() -> +- {foreach, ++ {timeout, 900, {foreach, + fun() -> + VnodePid = spawn(fun fake_loop/0), + meck:new(riak_core_vnode_manager, [passthrough]), +@@ -355,11 +355,11 @@ overload_test_() -> + end, + [ + fun({VnodePid, ProxyPid}) -> +- {"should not discard in normal operation", ++ {"should not discard in normal operation", timeout, 60, + fun() -> + [ProxyPid ! hello || _ <- lists:seq(1, 50000)], + %% synchronize on the mailbox +- Reply = gen:call(ProxyPid, '$vnode_proxy_call', sync), ++ Reply = gen:call(ProxyPid, '$vnode_proxy_call', sync, infinity), + ?assertEqual({ok, ok}, Reply), + VnodePid ! {get_count, self()}, + receive +@@ -371,12 +371,12 @@ overload_test_() -> + } + end, + fun({VnodePid, ProxyPid}) -> +- {"should discard during overflow", ++ {"should discard during overflow", timeout, 60, + fun() -> + VnodePid ! block, + [ProxyPid ! hello || _ <- lists:seq(1, 50000)], + %% synchronize on the mailbox +- Reply = gen:call(ProxyPid, '$vnode_proxy_call', sync), ++ Reply = gen:call(ProxyPid, '$vnode_proxy_call', sync, infinity), + ?assertEqual({ok, ok}, Reply), + VnodePid ! unblock, + VnodePid ! {get_count, self()}, +@@ -389,12 +389,12 @@ overload_test_() -> + } + end, + fun({VnodePid, ProxyPid}) -> +- {"should tolerate slow vnodes", ++ {"should tolerate slow vnodes", timeout, 60, + fun() -> + VnodePid ! slow, + [ProxyPid ! hello || _ <- lists:seq(1, 50000)], + %% synchronize on the mailbox +- Reply = gen:call(ProxyPid, '$vnode_proxy_call', sync), ++ Reply = gen:call(ProxyPid, '$vnode_proxy_call', sync, infinity), + ?assertEqual({ok, ok}, Reply), + %% check that the outstanding message count is + %% reasonable +@@ -405,5 +405,5 @@ overload_test_() -> + end + } + end +- ]}. ++ ]}}. + -endif. +-- +1.8.3.1 + diff --git a/erlang-riak_core.spec b/erlang-riak_core.spec index f0e2a43..9605418 100644 --- a/erlang-riak_core.spec +++ b/erlang-riak_core.spec @@ -14,7 +14,10 @@ License: ASL 2.0 URL: https://github.com/basho/riak_core # wget --content-disposition https://github.com/basho/riak_core/tarball/1.3.2 Source0: %{upstream}-%{realname}-%{version}-%{patchnumber}-g%{git_tag}.tar.gz +# Fedora/EPEL-specific Patch1: erlang-riak_core-0001-Fix-rebar-deps.patch +# Cherry-picked from upstream +Patch2: erlang-riak_core-0002-Fix-overload-test-time-outs.patch # Required for unit-tests only (if you're not interested in a compile-time # testing then you may remove these lines): @@ -67,6 +70,7 @@ Distributed systems infrastructure used by Riak. %prep %setup -q -n %{upstream}-%{realname}-356b592 %patch1 -p1 -b .deps +%patch2 -p1 -b .timeout %build