diff options
-rwxr-xr-x | quickcheck | 9 | ||||
-rw-r--r-- | src/rabbit_backing_queue_qc.erl | 5 |
2 files changed, 8 insertions, 6 deletions
@@ -6,15 +6,16 @@ %% A helper to test quickcheck properties on a running broker %% NodeStr is a local broker node name %% ModStr is the module containing quickcheck properties -%% The number of trials is optional -main([NodeStr, ModStr | TrialsStr]) -> +%% TrialsStr is the number of trials +main([NodeStr, ModStr, TrialsStr]) -> {ok, Hostname} = inet:gethostname(), Node = list_to_atom(NodeStr ++ "@" ++ Hostname), Mod = list_to_atom(ModStr), - Trials = lists:map(fun erlang:list_to_integer/1, TrialsStr), + Trials = erlang:list_to_integer(TrialsStr), case rpc:call(Node, code, ensure_loaded, [proper]) of {module, proper} -> - case rpc:call(Node, proper, module, [Mod] ++ Trials) of + case rpc:call(Node, proper, module, + [Mod] ++ [[{numtests, Trials}, {constraint_tries, 200}]]) of [] -> ok; _ -> quit(1) end; diff --git a/src/rabbit_backing_queue_qc.erl b/src/rabbit_backing_queue_qc.erl index 5cffa76d..20036c4f 100644 --- a/src/rabbit_backing_queue_qc.erl +++ b/src/rabbit_backing_queue_qc.erl @@ -42,7 +42,7 @@ messages, %% gb_trees of seqid => {msg_props, basic_msg} acks, %% [{acktag, {seqid, {msg_props, basic_msg}}}] confirms, %% set of msgid - publishing}).%% int (induce long chain of publishes) + publishing}).%% int %% Initialise model @@ -155,6 +155,7 @@ qc_purge(#state{bqstate = BQ}) -> %% Preconditions +%% Create long queues by only allowing publishing precondition(#state{publishing = Count}, {call, _Mod, Fun, _Arg}) when Count > 0, Fun /= publish -> false; @@ -320,7 +321,7 @@ postcondition(#state{bqstate = BQ, len = Len}, {call, _M, _F, _A}, _Res) -> %% Helpers -publish_multiple(C) -> +publish_multiple(_C) -> ok. timeout(BQ, 0) -> |