From b2a1841f9ceb4e386b393d7a41212e8938afaf4d Mon Sep 17 00:00:00 2001 From: Tyler Brock Date: Wed, 4 Apr 2012 19:10:02 -0400 Subject: [PATCH] minor: test fix for legacy mongo --- test/replica_sets/refresh_with_threads_test.rb | 12 +++++++----- test/tools/repl_set_manager.rb | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/test/replica_sets/refresh_with_threads_test.rb b/test/replica_sets/refresh_with_threads_test.rb index 6978de9..a690580 100644 --- a/test/replica_sets/refresh_with_threads_test.rb +++ b/test/replica_sets/refresh_with_threads_test.rb @@ -10,7 +10,6 @@ class ReplicaSetRefreshWithThreadsTest < Test::Unit::TestCase end def teardown - @rs.restart_killed_nodes @conn.close if @conn end @@ -45,11 +44,14 @@ class ReplicaSetRefreshWithThreadsTest < Test::Unit::TestCase end end - rescue_connection_failure do - @rs.add_node - threads.each {|t| t.join } - end + @rs.add_node + begin + threads.each {|t| t.join } + rescue ConnectionFailure + # 1.8x will raise connection failures + end + @conn['admin'].command({:ismaster => 1}) assert_equal 3, @conn.secondary_pools.length diff --git a/test/tools/repl_set_manager.rb b/test/tools/repl_set_manager.rb index b37eec7..a3de2f4 100644 --- a/test/tools/repl_set_manager.rb +++ b/test/tools/repl_set_manager.rb @@ -46,7 +46,7 @@ class ReplSetManager end def start_set - system("killall mongod > /dev/null 2>/dev/null") + system("killall mongod > /dev/null 2> /dev/null") sleep(1) should_start = true #puts "** Starting a replica set with #{@count} nodes"