diff --git a/test/replica_sets/pooled_insert_test.rb b/test/replica_sets/pooled_insert_test.rb index 57cc143..90ed2cf 100644 --- a/test/replica_sets/pooled_insert_test.rb +++ b/test/replica_sets/pooled_insert_test.rb @@ -34,6 +34,8 @@ class ReplicaSetPooledInsertTest < Test::Unit::TestCase end end + threads.each {|t| t.join} + # Restart the old master and wait for sync RS.restart_killed_nodes sleep(1) diff --git a/test/replica_sets/refresh_test.rb b/test/replica_sets/refresh_test.rb index c028319..f703c19 100644 --- a/test/replica_sets/refresh_test.rb +++ b/test/replica_sets/refresh_test.rb @@ -65,16 +65,14 @@ class ReplicaSetRefreshTest < Test::Unit::TestCase @conn = ReplSetConnection.new([RS.host, RS.ports[0]], [RS.host, RS.ports[1]], [RS.host, RS.ports[2]], :refresh_interval => 2, :auto_refresh => true) - assert @conn.secondaries.length == 2 - p @conn.secondaries - p @conn.secondary_pools.length + assert_equal 2, @conn.secondaries.length + assert_equal 2, @conn.secondary_pools.length RS.remove_secondary_node - sleep(6) + sleep(3) - p @conn.secondaries - p @conn.secondary_pools.length - assert @conn.secondaries.length == 1 + assert_equal 1, @conn.secondaries.length + assert_equal 1, @conn.secondary_pools.length end end