Sha256: 731fa339f926c1566fef669a5291da290e49ab7d66d957372359e980da3f24ff
Contents?: true
Size: 1.12 KB
Versions: 53
Compression:
Stored size: 1.12 KB
Contents
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'logger' require './test/replica_sets/rs_test_helper' class ComplexConnectTest < Test::Unit::TestCase def setup ensure_rs end def teardown @rs.restart_killed_nodes @conn.close if defined?(@conn) && @conn end def test_complex_connect logger = Logger.new(STDOUT) primary = Connection.new(@rs.host, @rs.ports[0]) @conn = ReplSetConnection.new([@rs.host, @rs.ports[2]], [@rs.host, @rs.ports[1]], [@rs.host, @rs.ports[0]], :logger => logger) @conn['test']['foo'].insert({:a => 1}) assert @conn['test']['foo'].find_one config = primary['local']['system.replset'].find_one config['version'] += 1 config['members'].delete_if do |member| member['host'].include?(@rs.ports[2].to_s) end assert_raise ConnectionFailure do primary['admin'].command({:replSetReconfig => config}) end @rs.ensure_up assert_raise ConnectionFailure do primary['admin'].command({:replSetStepDown => 1}) end rescue_connection_failure do assert @conn['test']['foo'].find_one end end end
Version data entries
53 entries across 53 versions & 3 rubygems