Sha256: 8a49cb1002fcd05ab027855589486adaa778a8d43980d0951a859c3db5d5f36f

Contents?: true

Size: 816 Bytes

Versions: 30

Compression:

Stored size: 816 Bytes

Contents

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

30 entries across 30 versions & 1 rubygems

Version Path
mongo-2.13.3 spec/integration/mongos_pinning_spec.rb
mongo-2.14.1 spec/integration/mongos_pinning_spec.rb
mongo-2.15.0.alpha spec/integration/mongos_pinning_spec.rb
mongo-2.13.2 spec/integration/mongos_pinning_spec.rb
mongo-2.14.0 spec/integration/mongos_pinning_spec.rb
mongo-2.14.0.rc1 spec/integration/mongos_pinning_spec.rb
mongo-2.13.1 spec/integration/mongos_pinning_spec.rb
mongo-2.12.4 spec/integration/mongos_pinning_spec.rb
mongo-2.11.6 spec/integration/mongos_pinning_spec.rb
mongo-2.13.0 spec/integration/mongos_pinning_spec.rb
mongo-2.12.3 spec/integration/mongos_pinning_spec.rb
mongo-2.13.0.rc1 spec/integration/mongos_pinning_spec.rb
mongo-2.12.2 spec/integration/mongos_pinning_spec.rb
mongo-2.10.5 spec/integration/mongos_pinning_spec.rb
mongo-2.11.5 spec/integration/mongos_pinning_spec.rb
mongo-2.13.0.beta1 spec/integration/mongos_pinning_spec.rb
mongo-2.12.1 spec/integration/mongos_pinning_spec.rb
mongo-2.12.0.rc0 spec/integration/mongos_pinning_spec.rb
mongo-2.11.4 spec/integration/mongos_pinning_spec.rb
mongo-2.10.4 spec/integration/mongos_pinning_spec.rb