RUBY-376 always cache original seed nodes
This commit is contained in:
parent
03303b8409
commit
b579a6347f
|
@ -271,7 +271,8 @@ module Mongo
|
|||
end
|
||||
|
||||
def update_seed_list(members)
|
||||
@seeds = members.map { |n| n.host_port }
|
||||
current_members = members.map { |n| n.host_port }
|
||||
@seeds = (@seeds + current_members).uniq
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -23,6 +23,13 @@ class BasicTest < Test::Unit::TestCase
|
|||
assert @conn.connected?
|
||||
end
|
||||
|
||||
def test_cache_original_seed_nodes
|
||||
@conn = ReplSetConnection.new([self.rs.host, self.rs.ports[1]], [self.rs.host, self.rs.ports[0]],
|
||||
[self.rs.host, self.rs.ports[2]], [self.rs.host, 19356], :name => self.rs.name)
|
||||
assert @conn.connected?
|
||||
assert @conn.seeds.include?([self.rs.host, 19356]), "Original seed nodes not cached!"
|
||||
end
|
||||
|
||||
def test_accessors
|
||||
seeds = [[self.rs.host, self.rs.ports[0]], [self.rs.host, self.rs.ports[1]],
|
||||
[self.rs.host, self.rs.ports[2]]]
|
||||
|
|
Loading…
Reference in New Issue