diff options
author | Loïc Hoguin <[email protected]> | 2025-02-25 16:33:07 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2025-02-25 16:33:07 +0100 |
commit | 85fe0a9e315d7af90d6089d0daf21a9bc6a10c0a (patch) | |
tree | d205f20f06a444706d9fa2cb1c5e9675b3bbbabe | |
parent | 96d8e29908747ed032433f8edbcd218c7556a462 (diff) | |
download | gun-85fe0a9e315d7af90d6089d0daf21a9bc6a10c0a.tar.gz gun-85fe0a9e315d7af90d6089d0daf21a9bc6a10c0a.tar.bz2 gun-85fe0a9e315d7af90d6089d0daf21a9bc6a10c0a.zip |
Improve graceful_shutdown_goaway_no_error test reliability
-rw-r--r-- | test/rfc7540_SUITE.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/rfc7540_SUITE.erl b/test/rfc7540_SUITE.erl index 5e72398..6ed3314 100644 --- a/test/rfc7540_SUITE.erl +++ b/test/rfc7540_SUITE.erl @@ -440,16 +440,17 @@ settings_ack_timeout(_) -> graceful_shutdown_goaway_no_error(_) -> doc("The NO_ERROR code must be used when initiating a graceful " "shutdown (RFC7540 6.8, RFC7540 7)"), - {ok, _, Port} = init_origin(tcp, http2, fun(Parent, _ListenSocket, Socket, _Transport) -> + {ok, OriginPid, OriginPort} = init_origin(tcp, http2, fun(Parent, _, Socket, Transport) -> %% Expect a GOAWAY with reason NO_ERROR. {ok, <<_:24, 7:8, 0:8, 0:1, 0:31, 0:1, 0:31, %% LastStreamID. 0:32 %% NO_ERROR. - >>} = gen_tcp:recv(Socket, 17, 500), + >>} = Transport:recv(Socket, 17, 500), Parent ! done end), - {ok, ConnPid} = gun:open("localhost", Port, #{protocols => [http2]}), + {ok, ConnPid} = gun:open("localhost", OriginPort, #{protocols => [http2]}), {ok, http2} = gun:await_up(ConnPid), + handshake_completed = receive_from(OriginPid), gun:shutdown(ConnPid), receive done -> ok end. |