From eea444f24a13dd884ac9362a320a0031e8fa7d30 Mon Sep 17 00:00:00 2001 From: dblock Date: Thu, 6 Feb 2025 09:47:21 -0500 Subject: [PATCH] Undo debugging changes. Signed-off-by: dblock --- spec/opensearch/transport/client_spec.rb | 27 ++++++++++-------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/spec/opensearch/transport/client_spec.rb b/spec/opensearch/transport/client_spec.rb index 6c5a8b3bc..b58cfb972 100644 --- a/spec/opensearch/transport/client_spec.rb +++ b/spec/opensearch/transport/client_spec.rb @@ -1762,53 +1762,48 @@ end end - context 'when typhoeus is used as an adapter', unless: jruby? do + context 'when patron is used as an adapter', unless: jruby? do before do - require 'typhoeus' + require 'patron' end let(:options) do - { adapter: :typhoeus } + { adapter: :patron } end let(:adapter) do client.transport.connections.first.connection.builder.adapter end - it 'uses the typhoeus connection handler' do - expect(adapter).to eq('Faraday::Adapter::Typhoeus') + it 'uses the patron connection handler' do + expect(adapter).to eq('Faraday::Adapter::Patron') end it 'keeps connections open' do - puts 'Testing with _cat/health' - puts client.perform_request('GET', '_cat/health') - puts 'Performing GET _nodes/stats/http' response = client.perform_request('GET', '_nodes/stats/http') connections_before = response.body['nodes'].values.find { |n| n['name'] == node_names.first }['http']['total_opened'] - puts 'Start reloading connections' client.transport.reload_connections! - puts 'Connections reloaded' response = client.perform_request('GET', '_nodes/stats/http') connections_after = response.body['nodes'].values.find { |n| n['name'] == node_names.first }['http']['total_opened'] expect(connections_after).to be >= (connections_before) end end - - context 'when patron is used as an adapter', unless: jruby? do + + context 'when typhoeus is used as an adapter', unless: jruby? do before do - require 'patron' + require 'typhoeus' end let(:options) do - { adapter: :patron } + { adapter: :typhoeus } end let(:adapter) do client.transport.connections.first.connection.builder.adapter end - it 'uses the patron connection handler' do - expect(adapter).to eq('Faraday::Adapter::Patron') + it 'uses the typhoeus connection handler' do + expect(adapter).to eq('Faraday::Adapter::Typhoeus') end it 'keeps connections open' do