Skip to content

Commit

Permalink
Add test for waiting with an open client connection
Browse files Browse the repository at this point in the history
  • Loading branch information
wjordan committed Feb 20, 2020
1 parent a948c16 commit 37ac08e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/test_puma_server.rb
Expand Up @@ -754,4 +754,17 @@ def test_request_body_wait_chunked
# it is set to a reasonable number.
assert_operator request_body_wait, :>=, 900
end

def test_open_connection_wait
server_run app: ->(_) { [200, {}, ["Hello"]] }
s = send_http nil
sleep 0.1
s << "GET / HTTP/1.0\r\n\r\n"
assert_equal 'Hello', s.readlines.last
end

def test_open_connection_wait_no_queue
@server = Puma::Server.new @app, @events, queue_requests: false
test_open_connection_wait
end
end

0 comments on commit 37ac08e

Please sign in to comment.