Skip to content

Commit

Permalink
Disable read_timeout test for em_http_request adapter on jruby
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Chernenkov committed Aug 24, 2018
1 parent 3453c7c commit 5dcf101
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions spec/integration/em_http_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,23 @@
expect(response.headers["Set-Cookie"]).to eq(cookies)
end

it "it supports read timeout" do
request = HTTPI::Request.new(@server.url + "timeout")
request.read_timeout = 0.5 # seconds

expect { HTTPI.get(request, adapter) }
.to raise_error { |error|
expect(error).to be_a(HTTPI::Adapter::EmHttpRequest::EmHttpTimeoutError)
expect(error).to be_a(HTTPI::TimeoutError)
}
if RUBY_PLATFORM =~ /java/
pending <<-MSG
It seems like JRuby is missing support for inactivity timeout! See related issues on GitHub:
- https://github.com/eventmachine/eventmachine/issues/155
- https://github.com/eventmachine/eventmachine/pull/312
MSG
else
it "it supports read timeout" do
request = HTTPI::Request.new(@server.url + "timeout")
request.read_timeout = 0.5 # seconds

expect { HTTPI.get(request, adapter) }
.to raise_error { |error|
expect(error).to be_a(HTTPI::Adapter::EmHttpRequest::EmHttpTimeoutError)
expect(error).to be_a(HTTPI::TimeoutError)
}
end
end

it "executes GET requests" do
Expand Down

0 comments on commit 5dcf101

Please sign in to comment.