Skip to content

Commit

Permalink
fix test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
ziopio committed May 27, 2024
1 parent 0226056 commit 340acc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/grisp_connect_ws.erl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
}).

-define(disconnected_state,
#state{gun_pid = undefined, gun_ref = undefine, ws_up = false}).
#state{gun_pid = undefined, gun_ref = undefine,
ws_up = false, ping_timer = undefined}).

-include_lib("kernel/include/logger.hrl").

Expand Down Expand Up @@ -118,7 +119,7 @@ handle_info(M, S) ->
% internal functions -----------------------------------------------------------

shutdown_gun(#state{gun_pid = Pid, gun_ref = GunRef,
ping_timer = PingTimer} = State) ->
ping_timer = PingTimer} = State) ->
timer:cancel(PingTimer),
demonitor(GunRef),
gun:shutdown(Pid),
Expand Down
2 changes: 1 addition & 1 deletion test/grisp_connect_api_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ link_device_test(_) ->
?assertMatch({ok, <<"pong">>}, grisp_connect:ping()).

reconnect_on_gun_crash_test(_) ->
{state, GunPid, _, _, _} = sys:get_state(grisp_connect_ws),
{state, GunPid, _, _, _, _} = sys:get_state(grisp_connect_ws),
proc_lib:stop(GunPid),
?assertMatch(ok, wait_disconnection()),
?assertMatch(ok, wait_connection()).
Expand Down

0 comments on commit 340acc0

Please sign in to comment.