mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
test(gateway): keep the recheck timer out of the eunit process (#3304)
This commit is contained in:
1 parent
ccbe4857a1
commit
0ec1cee99e
2 files changed
+11
-3
No files matched your search
@@ -269,8 +269,16 @@ schedule_availability_recheck_available_no_timer_test() ->
|
|||||||
|
|
||||||
schedule_availability_recheck_unavailable_sets_timer_test() ->
|
schedule_availability_recheck_unavailable_sets_timer_test() ->
|
||||||
State = #{data => #{<<"guild">> => #{<<"features">> => [<<"UNAVAILABLE_FOR_EVERYONE">>]}}},
|
State = #{data => #{<<"guild">> => #{<<"features">> => [<<"UNAVAILABLE_FOR_EVERYONE">>]}}},
|
||||||
Result = schedule_availability_recheck(State),
|
Parent = self(),
|
||||||
?assertEqual(State, Result).
|
{Pid, MonitorRef} = spawn_monitor(fun() ->
|
||||||
|
Parent ! {scheduled, self(), schedule_availability_recheck(State)}
|
||||||
|
end),
|
||||||
|
receive
|
||||||
|
{scheduled, Pid, Result} -> ?assertEqual(State, Result)
|
||||||
|
end,
|
||||||
|
receive
|
||||||
|
{'DOWN', MonitorRef, process, Pid, normal} -> ok
|
||||||
|
end.
|
||||||
|
|
||||||
handle_recheck_transition_clears_cache_on_recovery_test() ->
|
handle_recheck_transition_clears_cache_on_recovery_test() ->
|
||||||
GuildId = 99001,
|
GuildId = 99001,
|
||||||
|
|||||||
@@ -777,7 +777,7 @@ reference_update_member_subscriptions(SessionId, MemberIds, State) ->
|
|||||||
|
|
||||||
drain_mailbox(Acc) ->
|
drain_mailbox(Acc) ->
|
||||||
receive
|
receive
|
||||||
Msg -> drain_mailbox([Msg | Acc])
|
{'$gen_cast', _} = Msg -> drain_mailbox([Msg | Acc])
|
||||||
after 50 -> lists:reverse(Acc)
|
after 50 -> lists:reverse(Acc)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user