Skip to content

Commit

Permalink
fix 'too many connection resets' error that may occur during ci tests
Browse files Browse the repository at this point in the history
by lowering POST timeouts to 1.

From Net::HTTP::Persistent history.txt:
"Reducing the idle timeout is preferred
 over setting #retry_change_requests to true if you wish to avoid the "too
 many connection resets" error when POSTing data."
  • Loading branch information
coldnebo committed Aug 29, 2017
1 parent 696f650 commit c0c9ca8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/integration/net_http_persistent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
end

it "executes POST requests" do
response = HTTPI.post(@server.url, "<some>xml</some>", adapter)
request = HTTPI::Request.new(url: @server.url, open_timeout: 1, read_timeout: 1, body: "<some>xml</some>")

response = HTTPI.post(request, adapter)
expect(response.body).to eq("post")
expect(response.headers["Content-Type"]).to eq("text/plain")
end
Expand Down

0 comments on commit c0c9ca8

Please sign in to comment.