Skip to content

Commit 662fbbe

Browse files
committed
Adjust muc_SUITE to mongoose_helper:wait_until/2
1 parent f6608b2 commit 662fbbe

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

big_tests/tests/muc_SUITE.erl

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4098,7 +4098,7 @@ hibernated_room_can_be_queried_for_archive(Config) ->
40984098
[{membersonly, false}], Bob),
40994099
{Msg, {ok, _, Pid}} = Result,
41004100
wait_for_mam_result(RoomName, Bob, Msg),
4101-
true = wait_for_hibernation(Pid, 10)
4101+
wait_for_hibernation(Pid)
41024102

41034103
end),
41044104

@@ -4256,7 +4256,7 @@ get_spiral_metric_count(Host, MetricName) ->
42564256

42574257
given_fresh_room_is_hibernated(Owner, RoomName, Opts) ->
42584258
{ok, _, RoomPid} = Result = given_fresh_room_for_user(Owner, RoomName, Opts),
4259-
true = wait_for_hibernation(RoomPid, 10),
4259+
wait_for_hibernation(RoomPid),
42604260
Result.
42614261

42624262
given_fresh_room_for_user(Owner, RoomName, Opts) ->
@@ -4311,7 +4311,7 @@ given_fresh_room_with_participants_is_hibernated(Owner, RoomName, Opts, Particip
43114311
escalus:send(Participant, JoinRoom),
43124312
escalus:wait_for_stanzas(Participant, 3),
43134313
escalus:wait_for_stanza(Owner),
4314-
true = wait_for_hibernation(Pid, 10),
4314+
wait_for_hibernation(Pid),
43154315
Result.
43164316

43174317
given_fresh_room_with_messages_is_hibernated(Owner, RoomName, Opts, Participant) ->
@@ -4323,7 +4323,7 @@ given_fresh_room_with_messages_is_hibernated(Owner, RoomName, Opts, Participant)
43234323
escalus:send(Owner, Message),
43244324
escalus:assert(is_groupchat_message, [MessageBin], escalus:wait_for_stanza(Participant)),
43254325
escalus:assert(is_groupchat_message, [MessageBin], escalus:wait_for_stanza(Owner)),
4326-
true = wait_for_hibernation(Pid, 10),
4326+
wait_for_hibernation(Pid),
43274327
{MessageBin, Result}.
43284328

43294329
forget_room(ServerHost, MUCHost, RoomName) ->
@@ -4338,16 +4338,8 @@ wait_for_room_to_be_stopped(Pid, Timeout) ->
43384338
false
43394339
end.
43404340

4341-
wait_for_hibernation(Pid, 0) ->
4342-
is_hibernated(Pid);
4343-
wait_for_hibernation(Pid, N) ->
4344-
case is_hibernated(Pid) of
4345-
true ->
4346-
true;
4347-
_ ->
4348-
timer:sleep(500),
4349-
wait_for_hibernation(Pid, N-1)
4350-
end.
4341+
wait_for_hibernation(Pid) ->
4342+
mongoose_helper:wait_until(fun() -> is_hibernated(Pid) end, true).
43514343

43524344
is_hibernated(Pid) ->
43534345
CurrentFunction = rpc(mim(), erlang, process_info, [Pid, current_function]),

0 commit comments

Comments
 (0)