Skip to content

Commit

Permalink
Update test_timeout_in_data_phase
Browse files Browse the repository at this point in the history
Complete request to ensure short timeout is used properly.
  • Loading branch information
wjordan committed Apr 20, 2021
1 parent 7e11ad1 commit 2386e37
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/test_puma_server.rb
Expand Up @@ -383,11 +383,14 @@ def test_status_hook_fires_when_server_changes_states
end

def test_timeout_in_data_phase
@server.first_data_timeout = 2
@server.first_data_timeout = 1
server_run

sock = send_http "POST / HTTP/1.1\r\nHost: test.com\r\nContent-Type: text/plain\r\nContent-Length: 5\r\n\r\n"

sleep 1.15
sock << "Hello"

data = sock.gets

assert_equal "HTTP/1.1 408 Request Timeout\r\n", data
Expand Down

0 comments on commit 2386e37

Please sign in to comment.