mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Fix a test that worked intermittently
This commit is contained in:
parent
610f9e8d43
commit
916bfde1f8
1 changed files with 5 additions and 6 deletions
|
@ -332,12 +332,11 @@ ws_send_many(Config) ->
|
|||
{'Upgrade', "websocket"} = lists:keyfind('Upgrade', 1, Headers),
|
||||
{"sec-websocket-accept", "s3pPLMBiTxaQ9kYGzzhZRbK+xOo="}
|
||||
= lists:keyfind("sec-websocket-accept", 1, Headers),
|
||||
{ok, << 1:1, 0:3, 1:4, 0:1, 3:7, "one" >>}
|
||||
= gen_tcp:recv(Socket, 0, 6000),
|
||||
{ok, << 1:1, 0:3, 1:4, 0:1, 3:7, "two" >>}
|
||||
= gen_tcp:recv(Socket, 0, 6000),
|
||||
{ok, << 1:1, 0:3, 1:4, 0:1, 6:7, "seven!" >>}
|
||||
= gen_tcp:recv(Socket, 0, 6000),
|
||||
%% We catch all frames at once and check them directly.
|
||||
{ok, Many} = gen_tcp:recv(Socket, 18, 6000),
|
||||
<< 1:1, 0:3, 1:4, 0:1, 3:7, "one",
|
||||
1:1, 0:3, 1:4, 0:1, 3:7, "two",
|
||||
1:1, 0:3, 1:4, 0:1, 6:7, "seven!" >> = Many,
|
||||
ok = gen_tcp:send(Socket, << 1:1, 0:3, 8:4, 0:8 >>), %% close
|
||||
{ok, << 1:1, 0:3, 8:4, 0:8 >>} = gen_tcp:recv(Socket, 0, 6000),
|
||||
{error, closed} = gen_tcp:recv(Socket, 0, 6000),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue