spec/support/shared/session.rb in mongo-2.17.4 vs spec/support/shared/session.rb in mongo-2.18.0.beta1

- old
+ new

@@ -629,11 +629,12 @@ client.subscribe(Mongo::Monitoring::COMMAND, subscriber) end end shared_examples_for 'does not update the cluster time of the cluster' do - it 'does not update the cluster time of the cluster', retry: 3 do + retry_test + it 'does not update the cluster time of the cluster' do bct = before_cluster_time reply_cluster_time expect(client.cluster.cluster_time).to eq(before_cluster_time) end end @@ -642,23 +643,24 @@ context 'when the server is version 3.6' do min_server_fcv '3.6' context 'when the cluster is sharded or a replica set' do + retry_test require_topology :replica_set, :sharded let(:reply_cluster_time) do operation_with_session subscriber.succeeded_events[-1].reply['$clusterTime'] end - it 'updates the cluster time of the cluster', retry: 3 do + it 'updates the cluster time of the cluster' do rct = reply_cluster_time expect(cluster.cluster_time).to eq(rct) end - it 'updates the cluster time of the session', retry: 3 do + it 'updates the cluster time of the session' do rct = reply_cluster_time expect(session.cluster_time).to eq(rct) end end @@ -674,11 +676,12 @@ subscriber.succeeded_events[-1].reply['$clusterTime'] end it_behaves_like 'does not update the cluster time of the cluster' - it 'does not update the cluster time of the session', retry: 3 do + retry_test + it 'does not update the cluster time of the session' do reply_cluster_time expect(session.cluster_time).to be_nil end end end @@ -728,11 +731,12 @@ reply_cluster_time[Mongo::Cluster::CLUSTER_TIME].increment + 1) new_cluster_time = reply_cluster_time.dup new_cluster_time.merge(Mongo::Cluster::CLUSTER_TIME => new_timestamp) end - it 'includes the advanced cluster time in the second command', retry: 3 do + retry_test + it 'includes the advanced cluster time in the second command' do expect(second_command_cluster_time).to eq(advanced_cluster_time) end end context 'when the advanced cluster time is not greater than the existing cluster time' do @@ -744,11 +748,12 @@ reply_cluster_time[Mongo::Cluster::CLUSTER_TIME].increment - 1) new_cluster_time = reply_cluster_time.dup new_cluster_time.merge(Mongo::Cluster::CLUSTER_TIME => new_timestamp) end - it 'does not advance the cluster time', retry: 3 do + retry_test + it 'does not advance the cluster time' do expect(second_command_cluster_time).to eq(reply_cluster_time) end end end @@ -757,10 +762,11 @@ let(:second_command_cluster_time) do second_operation subscriber.non_auth_command_started_events[-1].command['$clusterTime'] end - it 'includes the received cluster time in the second command', retry: 3 do + retry_test + it 'includes the received cluster time in the second command' do reply_cluster_time expect(second_command_cluster_time).to eq(reply_cluster_time) end end end