Skip to content

Commit

Permalink
Add test (failing) for large GET response bodies in HTTP2
Browse files Browse the repository at this point in the history
  • Loading branch information
varnerac committed Apr 13, 2020
1 parent 1d1303f commit 902036d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/ace/http2_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,24 @@ defmodule Ace.HTTP2Test do
assert_receive {^client_stream, {:reset, :internal_error}}, 1000
end

test "large GET response" do
large_greeting = String.duplicate("*", 100_000)
{:ok, service} =
Ace.HTTP.Service.start_link(
{MyApp, %{greeting: large_greeting}},
port: 0,
certfile: Support.test_certfile(),
keyfile: Support.test_keyfile()
)

{:ok, port} = Ace.HTTP.Service.port(service)

{:ok, client} = Client.start_link({"localhost", port}, enable_push: false)
{:ok, response} = Client.send_sync(client, Raxx.request(:GET, "/"))
assert 200 == response.status
assert String.starts_with?(response.body, large_greeting)
end

@tag :skip
test "Lost connection is forwarded to the worker", %{port: port} do
Process.flag(:trap_exit, true)
Expand Down

0 comments on commit 902036d

Please sign in to comment.