From 29f37720534020446b1a153ea1b151defe198a51 Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Fri, 2 Dec 2011 17:42:18 -0500 Subject: [PATCH] RUBY-376 use new seed nodes first --- lib/mongo/util/pool_manager.rb | 2 +- test/replica_sets/basic_test.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mongo/util/pool_manager.rb b/lib/mongo/util/pool_manager.rb index 413171d..65faf84 100644 --- a/lib/mongo/util/pool_manager.rb +++ b/lib/mongo/util/pool_manager.rb @@ -272,7 +272,7 @@ module Mongo def update_seed_list(members) current_members = members.map { |n| n.host_port } - @seeds = (@seeds + current_members).uniq + @seeds = (current_members + @seeds).uniq end end diff --git a/test/replica_sets/basic_test.rb b/test/replica_sets/basic_test.rb index f7dbfe1..fc64d70 100644 --- a/test/replica_sets/basic_test.rb +++ b/test/replica_sets/basic_test.rb @@ -28,6 +28,7 @@ class BasicTest < Test::Unit::TestCase [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!" + assert_equal [self.rs.host, 19356], @conn.seeds.last, "Original seed nodes not cached!" end def test_accessors