From 351eeb65a2ca84ffa43d7713902820305736ecd1 Mon Sep 17 00:00:00 2001 From: Tyler Brock Date: Fri, 1 Jun 2012 16:34:04 -0400 Subject: [PATCH] minor: read preference test fix Secondary to remove is randomly chosen so test would randomly fail before this fix. --- test/replica_sets/read_preference_test.rb | 2 +- test/tools/repl_set_manager.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/replica_sets/read_preference_test.rb b/test/replica_sets/read_preference_test.rb index 8df640c..aa267ff 100644 --- a/test/replica_sets/read_preference_test.rb +++ b/test/replica_sets/read_preference_test.rb @@ -42,7 +42,7 @@ class ReadPreferenceTest < Test::Unit::TestCase @rs.add_arbiter @rs.remove_secondary_node - @conn = ReplSetConnection.new(build_seeds(2), :read => :secondary_only) + @conn = ReplSetConnection.new(build_seeds(3), :read => :secondary_only) @db = @conn.db(MONGO_TEST_DB) @coll = @db.collection("test-sets") diff --git a/test/tools/repl_set_manager.rb b/test/tools/repl_set_manager.rb index a3de2f4..f512bd5 100644 --- a/test/tools/repl_set_manager.rb +++ b/test/tools/repl_set_manager.rb @@ -152,6 +152,7 @@ class ReplSetManager end con.close + ensure_up return secondary end