Skip to content

Commit 2e368c7

Browse files
committed
[CLIENT] Addresses loaded libraries order flakey test
1 parent 0759f30 commit 2e368c7

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

elasticsearch-transport/spec/elasticsearch/transport/client_spec.rb

+7-10
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,14 @@
185185

186186
describe 'adapter' do
187187
context 'when no adapter is specified' do
188-
before do
189-
@klass = Net::HTTP::Persistent.clone
190-
Net::HTTP.send(:remove_const, :Persistent) if defined?(Net::HTTP::Persistent)
191-
end
192-
after { Net::HTTP::Persistent = @klass }
193-
194-
let(:adapter) { client.transport.connections.all.first.connection.builder.adapter }
188+
fork do
189+
let(:client) { described_class.new }
190+
let(:adapter) { client.transport.connections.all.first.connection.builder.adapter }
195191

196-
it 'uses Faraday NetHttp' do
197-
expect(adapter).to eq Faraday::Adapter::NetHttp
198-
end
192+
it 'uses Faraday NetHttp' do
193+
expect(adapter).to eq Faraday::Adapter::NetHttp
194+
end
195+
end unless jruby?
199196
end
200197

201198
context 'when the adapter is patron' do

0 commit comments

Comments
 (0)