minor: test tweaks for windows
This commit is contained in:
parent
7bebcd0499
commit
1b189336a6
|
@ -297,15 +297,15 @@ module Mongo
|
|||
def checkin(socket)
|
||||
@connection_mutex.synchronize do
|
||||
@checked_out.delete(socket)
|
||||
end
|
||||
@queue.signal
|
||||
end
|
||||
true
|
||||
end
|
||||
|
||||
# Adds a new socket to the pool and checks it out.
|
||||
#
|
||||
# This method is called exclusively from #obtain_socket;
|
||||
# therefore, it runs within a mutex, as it must.
|
||||
# This method is called exclusively from #checkout;
|
||||
# therefore, it runs within a mutex.
|
||||
def checkout_new_socket
|
||||
begin
|
||||
socket = TCPSocket.new(@host, @port)
|
||||
|
@ -320,8 +320,8 @@ module Mongo
|
|||
|
||||
# Checks out the first available socket from the pool.
|
||||
#
|
||||
# This method is called exclusively from #obtain_socket;
|
||||
# therefore, it runs within a mutex, as it must.
|
||||
# This method is called exclusively from #checkout;
|
||||
# therefore, it runs within a mutex.
|
||||
def checkout_existing_socket
|
||||
socket = (@sockets - @checked_out).first
|
||||
@checked_out << socket
|
||||
|
|
|
@ -4,7 +4,7 @@ class TestThreading < Test::Unit::TestCase
|
|||
|
||||
include Mongo
|
||||
|
||||
@@db = Connection.new('localhost', 27017, :pool_size => 1, :timeout => 5).db('ruby-mongo-test')
|
||||
@@db = Connection.new('localhost', 27017, :pool_size => 1, :timeout => 30).db('ruby-mongo-test')
|
||||
@@coll = @@db.collection('thread-test-collection')
|
||||
|
||||
def set_up_safe_data
|
||||
|
|
Loading…
Reference in New Issue