Sha256: 06f557eeca2c5400c80e6565f26f8ebdfbc705683977fc1efdabf851ab21e753

Contents?: true

Size: 865 Bytes

Versions: 18

Compression:

Stored size: 865 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

require 'spec_helper'

describe 'Mongos pinning' do
  require_topology :sharded
  min_server_fcv '4.2'

  let(:client) { authorized_client }
  let(:collection) { client['mongos_pinning_spec'] }

  before do
    collection.create
  end

  context 'successful operations' do
    it 'pins and unpins' do
      session = client.start_session
      expect(session.pinned_server).to be nil

      session.start_transaction
      expect(session.pinned_server).to be nil

      primary = client.cluster.next_primary

      collection.insert_one({a: 1}, session: session)
      expect(session.pinned_server).not_to be nil

      session.commit_transaction
      expect(session.pinned_server).not_to be nil

      collection.insert_one({a: 1}, session: session)
      expect(session.pinned_server).to be nil
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
mongo-2.16.4 spec/integration/mongos_pinning_spec.rb
mongo-2.17.4 spec/integration/mongos_pinning_spec.rb
mongo-2.18.3 spec/integration/mongos_pinning_spec.rb
mongo-2.18.2 spec/integration/mongos_pinning_spec.rb
mongo-2.17.3 spec/integration/mongos_pinning_spec.rb
mongo-2.18.1 spec/integration/mongos_pinning_spec.rb
mongo-2.18.0 spec/integration/mongos_pinning_spec.rb
mongo-2.17.2 spec/integration/mongos_pinning_spec.rb
mongo-2.16.3 spec/integration/mongos_pinning_spec.rb
mongo-2.18.0.beta1 spec/integration/mongos_pinning_spec.rb
mongo-2.16.2 spec/integration/mongos_pinning_spec.rb
mongo-2.17.1 spec/integration/mongos_pinning_spec.rb
mongo-2.16.1 spec/integration/mongos_pinning_spec.rb
mongo-2.17.0 spec/integration/mongos_pinning_spec.rb
mongo-2.16.0 spec/integration/mongos_pinning_spec.rb
mongo-2.15.1 spec/integration/mongos_pinning_spec.rb
mongo-2.16.0.alpha1 spec/integration/mongos_pinning_spec.rb
mongo-2.15.0 spec/integration/mongos_pinning_spec.rb