Sha256: 91ee8f39543f321a596cb19fb992cecfe6661d4eeebfcef79c14a23465398319
Contents?: true
Size: 800 Bytes
Versions: 9
Compression:
Stored size: 800 Bytes
Contents
require 'spec_helper' describe 'awaited ismaster' do min_server_fcv '4.4' # If we send the consecutive ismasters to different mongoses, # they have different process ids, and so the awaited one would return # immediately. require_no_multi_shard let(:client) { authorized_client } it 'waits' do # Perform a regular ismaster to get topology version resp = client.database.command(ismaster: 1) doc = resp.replies.first.documents.first tv = Mongo::TopologyVersion.new(doc['topologyVersion']) tv.should be_a(BSON::Document) elapsed_time = Benchmark.realtime do resp = client.database.command(ismaster: 1, topologyVersion: tv.to_doc, maxAwaitTimeMS: 500) end doc = resp.replies.first.documents.first elapsed_time.should > 0.5 end end
Version data entries
9 entries across 9 versions & 1 rubygems