From 7867e435fe6262d783f797c659e215dc14096449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 26 Jun 2018 10:32:33 +0200 Subject: Fix tests for most recent Gun --- test/examples_SUITE.erl | 10 +++++----- test/metrics_SUITE.erl | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/examples_SUITE.erl b/test/examples_SUITE.erl index ec3ebb1..c60315b 100644 --- a/test/examples_SUITE.erl +++ b/test/examples_SUITE.erl @@ -436,23 +436,23 @@ websocket(Config) -> {ok, Pid} = gun:open("127.0.0.1", 8080, #{protocols => [http], retry => 0}), {ok, http} = gun:await_up(Pid), _ = monitor(process, Pid), - gun:ws_upgrade(Pid, "/websocket", [], #{compress => true}), + StreamRef = gun:ws_upgrade(Pid, "/websocket", [], #{compress => true}), receive - {gun_ws_upgrade, Pid, ok, _} -> + {gun_upgrade, Pid, StreamRef, _, _} -> ok; Msg1 -> exit({connection_failed, Msg1}) end, %% Check that we receive the message sent on timer on init. receive - {gun_ws, Pid, {text, <<"Hello!">>}} -> + {gun_ws, Pid, StreamRef, {text, <<"Hello!">>}} -> ok after 2000 -> exit(timeout) end, %% Check that we receive subsequent messages sent on timer. receive - {gun_ws, Pid, {text, <<"How' you doin'?">>}} -> + {gun_ws, Pid, StreamRef, {text, <<"How' you doin'?">>}} -> ok after 2000 -> exit(timeout) @@ -460,7 +460,7 @@ websocket(Config) -> %% Check that we receive the echoed message. gun:ws_send(Pid, {text, <<"hello">>}), receive - {gun_ws, Pid, {text, <<"That's what she said! hello">>}} -> + {gun_ws, Pid, StreamRef, {text, <<"That's what she said! hello">>}} -> ok after 500 -> exit(timeout) diff --git a/test/metrics_SUITE.erl b/test/metrics_SUITE.erl index 6af4492..92f8016 100644 --- a/test/metrics_SUITE.erl +++ b/test/metrics_SUITE.erl @@ -371,7 +371,7 @@ do_ws(Config) -> doc("Confirm metrics are correct when switching to Websocket."), ConnPid = gun_open(Config), {ok, http} = gun:await_up(ConnPid), - gun:ws_upgrade(ConnPid, "/ws_echo", [ + StreamRef = gun:ws_upgrade(ConnPid, "/ws_echo", [ {<<"accept-encoding">>, <<"gzip">>}, {<<"x-test-pid">>, pid_to_list(self())} ]), @@ -428,7 +428,7 @@ do_ws(Config) -> end, %% And of course the upgrade completed successfully after that. receive - {gun_ws_upgrade, ConnPid, ok, _} -> + {gun_upgrade, ConnPid, StreamRef, _, _} -> ok after 1000 -> error(timeout) -- cgit v1.2.3