Skip to content

Commit

Permalink
extend wait_for_stanzas timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
michalwski committed Sep 13, 2016
1 parent 773fe12 commit 1c1b2c1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/ejabberd_tests/tests/bosh_interleave_reqs.erl
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,10 @@ prop(Config) ->
end)).

ct_config_giver(Config) ->
wait_for_request(Config).

wait_for_request(Config) ->
receive
{give_me_config, Pid} ->
Pid ! {ok, Config},
wait_for_request(Config)
ct_config_giver(Config)
end.

maybe_stop_client(undefined) -> ok;
Expand Down Expand Up @@ -138,7 +135,7 @@ connect_user(Spec) ->
{ok, Conn, Props, _} = escalus_connection:start([{resource, Res} | Spec]),
JID = make_jid(Props),
escalus:send(Conn, escalus_stanza:presence(<<"available">>)),
escalus:wait_for_stanza(Conn),
escalus:wait_for_stanza(Conn, timer:seconds(5)),
Conn#client{jid = JID}.

make_jid(Proplist) ->
Expand Down Expand Up @@ -167,7 +164,7 @@ gen_msg() ->

wait_for_msgs_carol(Carol, Msgs) ->
L = length(Msgs),
Stanzas = escalus:wait_for_stanzas(Carol, L),
Stanzas = escalus:wait_for_stanzas(Carol, L, timer:seconds(5)),
RMsgs = [exml_query:path(E, [{element, <<"body">>}, cdata])
|| E <- Stanzas],
SortedMsgs = lists:sort([Msg || {_, Msg} <- Msgs]),
Expand All @@ -182,6 +179,6 @@ wait_for_msgs(_Client, []) ->
ok;
wait_for_msgs(Client, [{_, Msg} | Rest]) ->
escalus:assert(is_chat_message, [Msg],
escalus:wait_for_stanza(Client)),
escalus:wait_for_stanza(Client, timer:seconds(5))),
wait_for_msgs(Client, Rest).

0 comments on commit 1c1b2c1

Please sign in to comment.