Removed redundant test
This commit is contained in:
parent
34b6f023eb
commit
550db8f671
@ -1,41 +0,0 @@
|
|||||||
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
||||||
require 'mongo'
|
|
||||||
require 'test/unit'
|
|
||||||
require './test/test_helper'
|
|
||||||
|
|
||||||
# NOTE: This test expects a replica set of three nodes, one of which is an arbiter, to be running
|
|
||||||
# on the local host.
|
|
||||||
class ReplicaSetNodeTypeTest < Test::Unit::TestCase
|
|
||||||
include Mongo
|
|
||||||
|
|
||||||
def setup
|
|
||||||
@conn = ReplSetConnection.new([RS.host, RS.ports[0]], [RS.host, RS.ports[1]], [RS.host, RS.ports[2]])
|
|
||||||
@db = @conn.db(MONGO_TEST_DB)
|
|
||||||
@db.drop_collection("test-sets")
|
|
||||||
@coll = @db.collection("test-sets")
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_correct_node_types
|
|
||||||
p @conn.primary
|
|
||||||
p @conn.secondaries
|
|
||||||
p @conn.arbiters
|
|
||||||
assert_equal 1, @conn.secondaries.length
|
|
||||||
assert_equal 1, @conn.arbiters.length
|
|
||||||
|
|
||||||
old_secondary = @conn.secondaries.first
|
|
||||||
old_primary = @conn.primary
|
|
||||||
|
|
||||||
RS.step_down_primary
|
|
||||||
|
|
||||||
# Insert something to rescue the connection failure.
|
|
||||||
rescue_connection_failure do
|
|
||||||
@coll.insert({:a => 30}, :safe => true)
|
|
||||||
end
|
|
||||||
|
|
||||||
assert_equal 1, @conn.secondaries.length
|
|
||||||
assert_equal 1, @conn.arbiters.length
|
|
||||||
assert_equal old_primary, @conn.secondaries.first
|
|
||||||
assert_equal old_secondary, @conn.primary
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
Loading…
Reference in New Issue
Block a user