minor: test fix
This commit is contained in:
parent
83ac53202e
commit
9cb9f5c663
|
@ -79,15 +79,15 @@ module Mongo
|
||||||
@refresh_required
|
@refresh_required
|
||||||
end
|
end
|
||||||
|
|
||||||
def close
|
def close(opts={})
|
||||||
begin
|
begin
|
||||||
if @primary_pool
|
if @primary_pool
|
||||||
@primary_pool.close
|
@primary_pool.close(opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
if @secondary_pools
|
if @secondary_pools
|
||||||
@secondary_pools.each do |pool|
|
@secondary_pools.each do |pool|
|
||||||
pool.close
|
pool.close(opts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -101,14 +101,18 @@ class ReplicaSetRefreshTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_adding_and_removing_nodes
|
def test_adding_and_removing_nodes
|
||||||
@conn = ReplSetConnection.new([self.rs.host, self.rs.ports[0]], [self.rs.host, self.rs.ports[1]],
|
@conn = ReplSetConnection.new([self.rs.host, self.rs.ports[0]],
|
||||||
[self.rs.host, self.rs.ports[2]], :refresh_interval => 2, :refresh_mode => :async)
|
[self.rs.host, self.rs.ports[1]],
|
||||||
|
[self.rs.host, self.rs.ports[2]],
|
||||||
|
:refresh_interval => 2, :refresh_mode => :async)
|
||||||
|
|
||||||
self.rs.add_node
|
self.rs.add_node
|
||||||
sleep(4)
|
sleep(4)
|
||||||
|
|
||||||
@conn2 = ReplSetConnection.new([self.rs.host, self.rs.ports[0]], [self.rs.host, self.rs.ports[1]],
|
@conn2 = ReplSetConnection.new([self.rs.host, self.rs.ports[0]],
|
||||||
[self.rs.host, self.rs.ports[2]], :refresh_interval => 2, :refresh_mode => :async)
|
[self.rs.host, self.rs.ports[1]],
|
||||||
|
[self.rs.host, self.rs.ports[2]],
|
||||||
|
:refresh_interval => 2, :refresh_mode => :async)
|
||||||
|
|
||||||
assert @conn2.secondaries == @conn.secondaries
|
assert @conn2.secondaries == @conn.secondaries
|
||||||
assert_equal 3, @conn.secondary_pools.length
|
assert_equal 3, @conn.secondary_pools.length
|
||||||
|
|
Loading…
Reference in New Issue