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 9b5604b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/test_puma_server.rb
Expand Up @@ -383,11 +383,13 @@ 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"

sock << "Hello" unless IO.select([sock], nil, nil, 1.15)

data = sock.gets

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

0 comments on commit 9b5604b

Please sign in to comment.