From 5dcf101687a0a609fece321b949cf4a5c4c69177 Mon Sep 17 00:00:00 2001 From: Alexey Chernenkov Date: Fri, 24 Aug 2018 13:05:23 +0500 Subject: [PATCH] Disable read_timeout test for em_http_request adapter on jruby --- spec/integration/em_http_spec.rb | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/spec/integration/em_http_spec.rb b/spec/integration/em_http_spec.rb index 96c6504..21be266 100644 --- a/spec/integration/em_http_spec.rb +++ b/spec/integration/em_http_spec.rb @@ -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