Skip to content

Commit 804b6d0

Browse files
committed
disable flaky tests in JRuby 9.2
1 parent 8602868 commit 804b6d0

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

.circleci/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ workflows:
2020
name: JRuby 9.2
2121
docker-image: jruby:9.2-jdk
2222
jruby: true
23+
skip-end-to-end-http-tests: 1 # webrick doesn't work reliably in JRuby 9.2
2324
- build-test-linux:
2425
name: JRuby 9.3
2526
docker-image: jruby:9.3-jdk
@@ -33,10 +34,16 @@ jobs:
3334
jruby:
3435
type: boolean
3536
default: false
37+
skip-end-to-end-http-tests:
38+
type: string
39+
default: ""
3640

3741
docker:
3842
- image: <<parameters.docker-image>>
3943

44+
env:
45+
LD_SKIP_END_TO_END_HTTP_TESTS: <<parameters.skip-end-to-end-http-tests>>
46+
4047
steps:
4148
- checkout
4249
- when:

spec/client_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
# End-to-end tests of the SSE client against a real server
66
#
77
describe SSE::Client do
8+
before(:each) do
9+
skip("end-to-end HTTP tests are disabled because they're unreliable on this platform") if !stub_http_server_available?
10+
end
11+
812
subject { SSE::Client }
913

1014
let(:simple_event_1) { SSE::StreamEvent.new(:go, "foo")}

spec/http_stub.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
require "webrick/httpproxy"
33
require "webrick/https"
44

5+
def stub_http_server_available?
6+
flag = ENV["LD_SKIP_END_TO_END_HTTP_TESTS"]
7+
flag.nil? || flag == ""
8+
end
9+
510
class StubHTTPServer
611
attr_reader :port
712

0 commit comments

Comments
 (0)