Skip to content

Commit 1de8c97

Browse files
committed
Work toward pool tests
1 parent 6276c81 commit 1de8c97

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

elasticsearch-transport/lib/elasticsearch/transport/transport/http/manticore/pool.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ class Manticore
66
class Pool
77
attr_reader :logger
88

9-
def initialize(logger, adapter, healthcheck_url, urls=[], resurrect_interval=5)
9+
def initialize(logger, adapter, healthcheck_path="/", urls=[], resurrect_interval=5)
1010
@logger = logger
1111
@state_mutex = Mutex.new
1212
@url_info = {}
1313
@adapter = adapter
14-
@healthcheck_url = healthcheck_url
14+
@healthcheck_path = healthcheck_path
1515
@stopping = false
1616
@resurrect_interval = resurrect_interval
1717
@resurrectionist = start_resurrectionist
@@ -58,7 +58,7 @@ def resurrect_dead!
5858
# Try to keep locking granularity low such that we don't affect IO...
5959
@state_mutex.synchronize { @url_info.select {|url,meta| meta[:dead] } }.each do |url,meta|
6060
begin
61-
perform_request_to_url(url, "GET", @healthcheck_url)
61+
perform_request_to_url(url, "GET", @healthcheck_path)
6262
# If no exception was raised it must have succeeded!
6363
logger.warn("Resurrected connection to dead ES instance at #{url}")
6464
@state_mutex.synchronize { meta[:dead] = false }

elasticsearch-transport/test/unit/transport_manticore_pool.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ class Elasticsearch::Transport::Transport::HTTP::ManticorePoolTest < Test::Unit:
1212

1313
context "Manticore transport" do
1414
setup do
15-
@transport = Manticore.new :hosts => [ { :host => '127.0.0.1', :port => 8080 } ]
15+
@logger = Logger.new
16+
@adapter = mock()
17+
@healthcheck_path = "/healthcheck"
18+
@pool = ::Elasticsearch::Transport::Transport::HTTP::Manticore::Pool.new(@logger, @adapter, @healthcheck_path)
1619
end
17-
1820
end
1921
end
2022
end

0 commit comments

Comments
 (0)