Sha256: d00663344c1169b06df5ff9ef3ae5707e5095e4fea1ab285faa0e8a095326ac2

Contents?: true

Size: 791 Bytes

Versions: 14

Compression:

Stored size: 791 Bytes

Contents

require 'spec_helper'

describe 'Server::Monitor' do

  let(:client) do
    new_local_client([ClusterConfig.instance.primary_address_str],
      SpecConfig.instance.test_options.merge(SpecConfig.instance.auth_options.merge(
        heartbeat_frequency: 1)))
  end

  it 'refreshes server descriptions in background', retry: 3 do
    server = client.cluster.next_primary

    expect(server.description).not_to be_unknown

    server.unknown!

    # This is racy, especially in JRuby, because the monitor may have
    # already run and updated the description. Because of this we retry
    # the test a few times.
    expect(server.description).to be_unknown

    # Wait for background thread to update the description
    sleep 1.5

    expect(server.description).not_to be_unknown
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mongo-2.12.4 spec/integration/server_monitor_spec.rb
mongo-2.11.6 spec/integration/server_monitor_spec.rb
mongo-2.12.3 spec/integration/server_monitor_spec.rb
mongo-2.12.2 spec/integration/server_monitor_spec.rb
mongo-2.11.5 spec/integration/server_monitor_spec.rb
mongo-2.13.0.beta1 spec/integration/server_monitor_spec.rb
mongo-2.12.1 spec/integration/server_monitor_spec.rb
mongo-2.12.0.rc0 spec/integration/server_monitor_spec.rb
mongo-2.11.4 spec/integration/server_monitor_spec.rb
mongo-2.11.3 spec/integration/server_monitor_spec.rb
mongo-2.11.2 spec/integration/server_monitor_spec.rb
mongo-2.11.1 spec/integration/server_monitor_spec.rb
mongo-2.11.0 spec/integration/server_monitor_spec.rb
mongo-2.11.0.rc0 spec/integration/server_monitor_spec.rb