minor: replica set test fixes

This commit is contained in:
Kyle Banker 2011-08-30 16:16:47 -04:00
parent 8b2de82464
commit e8a5375cbf
3 changed files with 4 additions and 3 deletions

View File

@ -158,7 +158,7 @@ module Mongo
if !config['hosts'] if !config['hosts']
message = "Will not connect to #{host_string} because it's not a member " + message = "Will not connect to #{host_string} because it's not a member " +
"of a replica set." "of a replica set."
raise ReplicaSetConnectionError, message raise ConnectionFailure, message
end end
end end
@ -171,7 +171,7 @@ module Mongo
elsif self.connection.replica_set_name != config['setName'] elsif self.connection.replica_set_name != config['setName']
message = "Attempting to connect to replica set '#{config['setName']}' on member #{host_string} " + message = "Attempting to connect to replica set '#{config['setName']}' on member #{host_string} " +
"but expected '#{self.connection.replica_set_name}'" "but expected '#{self.connection.replica_set_name}'"
raise ReplicaSetConnectionError, message raise ConnectionFailure, message
end end
end end
end end

View File

@ -354,7 +354,7 @@ module Mongo
if @primary_pool if @primary_pool
begin begin
socket = @primary_pool.checkout socket = @primary_pool.checkout
@sockets_to_pools[socket] = @primary @sockets_to_pools[socket] = @primary_pool
return socket return socket
rescue NoMethodError rescue NoMethodError
end end

View File

@ -94,6 +94,7 @@ module Mongo
@read_pool = manager.read_pool @read_pool = manager.read_pool
@arbiters = manager.arbiters @arbiters = manager.arbiters
@hosts = manager.hosts @hosts = manager.hosts
@tags_to_pools = {}
end end
def initialize_data def initialize_data