Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close connection in web server tests [skip changelog] #2072

Merged
merged 1 commit into from Nov 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions test/test_web_server.rb
Expand Up @@ -19,7 +19,7 @@ def call(env)
class WebServerTest < Minitest::Test
parallelize_me!

VALID_REQUEST = "GET / HTTP/1.1\r\nHost: www.zedshaw.com\r\nContent-Type: text/plain\r\n\r\n"
VALID_REQUEST = "GET / HTTP/1.1\r\nHost: www.zedshaw.com\r\nContent-Type: text/plain\r\nConnection: close\r\n\r\n"

def setup
@tester = TestHandler.new
Expand Down Expand Up @@ -63,10 +63,9 @@ def test_header_is_too_long
end
end

# TODO: Why does this test take exactly 20 seconds?
def test_file_streamed_request
body = "a" * (Puma::Const::MAX_BODY * 2)
long = "GET /test HTTP/1.1\r\nContent-length: #{body.length}\r\n\r\n" + body
long = "GET /test HTTP/1.1\r\nContent-length: #{body.length}\r\nConnection: close\r\n\r\n" + body
socket = do_test(long, (Puma::Const::CHUNK_SIZE * 2) - 400)
assert_match "hello", socket.read
socket.close
Expand Down