Skip to content

Commit

Permalink
Handle window chttpd small buffer test responses
Browse files Browse the repository at this point in the history
On Windows it seems the sockets are closed and we get the `connection_closed`
error. Account for that error as well as a 400 or a `request_failed` response.

It behaves differently on Windows. At some point in the future investigate the
details but for now let's just bypass it.
  • Loading branch information
nickva committed Jan 26, 2023
1 parent 23efd8e commit 075d596
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/chttpd/test/eunit/chttpd_socket_buffer_size_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,23 @@ small_recbuf(_, {_, Db}) ->
?_test(begin
Id = data(2048),
Response = put_req(url(Db) ++ "/" ++ Id, "{}"),
?assert(Response =:= 400 orelse Response =:= request_failed)
?assert(
Response =:= 400 orelse
Response =:= request_failed orelse
Response =:= connection_closed
)
end)}.

small_buffer(_, {_, Db}) ->
{timeout, 30,
?_test(begin
Id = data(2048),
Response = put_req(url(Db) ++ "/" ++ Id, "{}"),
?assert(Response =:= 400 orelse Response =:= request_failed)
?assert(
Response =:= 400 orelse
Response =:= request_failed orelse
Response =:= connection_closed
)
end)}.

default_buffer(_, {_, Db}) ->
Expand Down

0 comments on commit 075d596

Please # to comment.