Sha256: e8f01eef22271e9f377d8741965cfa998e8e4490807f2d78120295f6125e673b

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require './test/replica_sets/rs_test_helper'

# TODO: enable this once we enable reads from tags.
class ReadPreferenceTest < Test::Unit::TestCase
  include Mongo

  #def setup
  #  @conn = ReplSetConnection.new([RS.host, RS.ports[0], RS.host, RS.ports[1]], :read => :secondary, :pool_size => 50)
  #  @db = @conn.db(MONGO_TEST_DB)
  #  @db.drop_collection("test-sets")
  #end

  # TODO: enable this once we enable reads from tags.
  # def test_query_tagged
  #   col = @db['mongo-test']

  #   col.insert({:a => 1}, :safe => {:w => 3})
  #   col.find_one({}, :read => {:db => "main"})
  #   col.find_one({}, :read => {:dc => "ny"})
  #   col.find_one({}, :read => {:dc => "sf"})

  #   assert_raise Mongo::NodeWithTagsNotFound do
  #     col.find_one({}, :read => {:foo => "bar"})
  #   end

  #   threads = []
  #   100.times do
  #     threads << Thread.new do
  #       col.find_one({}, :read => {:dc => "sf"})
  #     end
  #   end

  #   threads.each {|t| t.join }

  #   col.remove
  # end

  #def teardown
  #  RS.restart_killed_nodes
  #end

end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
jmongo-1.1.5 test/replica_sets/read_preference_test.rb
jmongo-1.1.4 test/replica_sets/read_preference_test.rb
jmongo-1.1.3 test/replica_sets/read_preference_test.rb
jmongo-1.1.2 test/replica_sets/read_preference_test.rb
jmongo-1.1.1 test/replica_sets/read_preference_test.rb
jmongo-1.1.0 test/replica_sets/read_preference_test.rb
mongo-1.4.0 test/replica_sets/read_preference_test.rb