diff options
author | Wei Huang <[email protected]> | 2022-04-01 22:35:17 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2022-11-08 12:45:25 +0100 |
commit | 9591d4c2df694115c5c5ff1b159117fa3032d428 (patch) | |
tree | 98a6f4d63fc8d14c65fb97cef7048c44a7388ea1 /test/shutdown_SUITE.erl | |
parent | 7507a8abbca2b7fe14ad18336d807581f6ce4f59 (diff) | |
download | gun-9591d4c2df694115c5c5ff1b159117fa3032d428.tar.gz gun-9591d4c2df694115c5c5ff1b159117fa3032d428.tar.bz2 gun-9591d4c2df694115c5c5ff1b159117fa3032d428.zip |
Include Websocket StreamRef in gun_down messages
Diffstat (limited to 'test/shutdown_SUITE.erl')
-rw-r--r-- | test/shutdown_SUITE.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/shutdown_SUITE.erl b/test/shutdown_SUITE.erl index 891aed8..87de32c 100644 --- a/test/shutdown_SUITE.erl +++ b/test/shutdown_SUITE.erl @@ -593,6 +593,7 @@ ws_gun_send_close_frame(Config) -> Frame = {close, 3333, <<>>}, gun:ws_send(ConnPid, StreamRef, Frame), {ws, Frame} = gun:await(ConnPid, StreamRef), + ws_is_down(ConnPid, StreamRef, normal), gun_is_down(ConnPid, ConnRef, normal). ws_gun_receive_close_frame(Config) -> @@ -607,6 +608,7 @@ ws_gun_receive_close_frame(Config) -> {upgrade, [<<"websocket">>], _} = gun:await(ConnPid, StreamRef), %% We expect a close frame before the connection is closed. {ws, {close, 3333, <<>>}} = gun:await(ConnPid, StreamRef), + ws_is_down(ConnPid, StreamRef, normal), gun_is_down(ConnPid, ConnRef, normal). closing_gun_shutdown(Config) -> @@ -659,3 +661,11 @@ gun_is_down(ConnPid, ConnRef, Expected) -> Expected = Reason, ok end. + +ws_is_down(ConnPid, StreamRef, Expected) -> + receive + {gun_down, ConnPid, ws, Reason, StreamsDown} -> + Expected = Reason, + [StreamRef] = StreamsDown, + ok + end. |