0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Fix an intermittent test failure

This commit is contained in:
Loïc Hoguin 2024-01-16 11:21:30 +01:00
parent 308045fd67
commit 920adb9b82
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764

View file

@ -511,7 +511,12 @@ request_timeout_skip_body_more(Config) ->
%% Missing final \r\n on purpose. %% Missing final \r\n on purpose.
>>), >>),
%% Connection should be closed by the request_timeout after that. %% Connection should be closed by the request_timeout after that.
{error, closed} = raw_recv(Client, 1, 1000) %% We attempt to send a 408 response on a best effort basis so
%% that is accepted as well.
case raw_recv(Client, 13, 1000) of
{error, closed} -> ok;
{ok, <<"HTTP/1.1 408 ", _/bits>>} -> ok
end
after after
cowboy:stop_listener(?FUNCTION_NAME) cowboy:stop_listener(?FUNCTION_NAME)
end. end.