Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2468

Some tests using internet are not skipped on EXTERNAL_DISABLED=1

      I got the following test failures in the no network (no interent) envrironment, even when using EXTERNAL_DISABLED=1 environment varialbe.
      I think the commonly accessed line ./spec/mongo/uri/srv_protocol_spec.rb:988 can be skipped when the environment variable is set.

      ruby -I lib:spec/shared/lib:spec <<EOR
        require 'mongo'
        require 'support/utils'
        require 'support/spec_setup'
        SpecSetup.new.run
      EOR
      
      CI=1 EXTERNAL_DISABLED=1 rspec spec -f p
      ...
      Failures:
        1) Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname is valid does not raise an error
           Failure/Error: expect { validate }.not_to raise_error
             expected no Exception, got #<Mongo::Error::NoSRVRecords: The DNS query returned no SRV records for 'test1.test.build.10gen.cc'> with backtrace:
               # ./lib/mongo/srv/resolver.rb:91:in `get_records'
               # ./lib/mongo/uri/srv_protocol.rb:152:in `parse!'
               # ./lib/mongo/uri.rb:298:in `initialize'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `new'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:992:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1001:in `block (5 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1001:in `block (4 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
               # /usr/share/ruby/timeout.rb:95:in `block in timeout'
               # /usr/share/ruby/timeout.rb:33:in `block in catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:110:in `timeout'
               # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
               # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
           # ./spec/mongo/uri/srv_protocol_spec.rb:1001:in `block (4 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
           # /usr/share/ruby/timeout.rb:95:in `block in timeout'
           # /usr/share/ruby/timeout.rb:33:in `block in catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:110:in `timeout'
           # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
           # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
        2) Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname has a trailing dot raises an error
           Failure/Error: expect { validate }.to raise_error(Mongo::Error::InvalidURI, /Hostname cannot end with a dot: a\.b\.c\./)
             expected Mongo::Error::InvalidURI with message matching /Hostname cannot end with a dot: a\.b\.c\./, got #<Mongo::Error::NoSRVRecords: The DNS query returned no SRV records for 'test1.test.build.10gen.cc'> with backtrace:
               # ./lib/mongo/srv/resolver.rb:91:in `get_records'
               # ./lib/mongo/uri/srv_protocol.rb:152:in `parse!'
               # ./lib/mongo/uri.rb:298:in `initialize'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `new'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:992:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1011:in `block (5 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1011:in `block (4 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
               # /usr/share/ruby/timeout.rb:95:in `block in timeout'
               # /usr/share/ruby/timeout.rb:33:in `block in catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:110:in `timeout'
               # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
               # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
           # ./spec/mongo/uri/srv_protocol_spec.rb:1011:in `block (4 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
           # /usr/share/ruby/timeout.rb:95:in `block in timeout'
           # /usr/share/ruby/timeout.rb:33:in `block in catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:110:in `timeout'
           # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
           # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
        3) Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname is empty raises an error
           Failure/Error: expect { validate }.to raise_error(Mongo::Error::InvalidURI)
             expected Mongo::Error::InvalidURI, got #<Mongo::Error::NoSRVRecords: The DNS query returned no SRV records for 'test1.test.build.10gen.cc'> with backtrace:
               # ./lib/mongo/srv/resolver.rb:91:in `get_records'
               # ./lib/mongo/uri/srv_protocol.rb:152:in `parse!'
               # ./lib/mongo/uri.rb:298:in `initialize'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `new'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:992:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1021:in `block (5 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1021:in `block (4 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
               # /usr/share/ruby/timeout.rb:95:in `block in timeout'
               # /usr/share/ruby/timeout.rb:33:in `block in catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:110:in `timeout'
               # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
               # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
           # ./spec/mongo/uri/srv_protocol_spec.rb:1021:in `block (4 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
           # /usr/share/ruby/timeout.rb:95:in `block in timeout'
           # /usr/share/ruby/timeout.rb:33:in `block in catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:110:in `timeout'
           # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
           # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
        4) Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname has only one part raises an error
           Failure/Error: expect { validate }.to raise_error(Mongo::Error::InvalidURI)
             expected Mongo::Error::InvalidURI, got #<Mongo::Error::NoSRVRecords: The DNS query returned no SRV records for 'test1.test.build.10gen.cc'> with backtrace:
               # ./lib/mongo/srv/resolver.rb:91:in `get_records'
               # ./lib/mongo/uri/srv_protocol.rb:152:in `parse!'
               # ./lib/mongo/uri.rb:298:in `initialize'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `new'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:992:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1031:in `block (5 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1031:in `block (4 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
               # /usr/share/ruby/timeout.rb:95:in `block in timeout'
               # /usr/share/ruby/timeout.rb:33:in `block in catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:110:in `timeout'
               # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
               # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
           # ./spec/mongo/uri/srv_protocol_spec.rb:1031:in `block (4 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
           # /usr/share/ruby/timeout.rb:95:in `block in timeout'
           # /usr/share/ruby/timeout.rb:33:in `block in catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:110:in `timeout'
           # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
           # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
        5) Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname has only two parts raises an error
           Failure/Error: expect { validate }.to raise_error(Mongo::Error::InvalidURI)
             expected Mongo::Error::InvalidURI, got #<Mongo::Error::NoSRVRecords: The DNS query returned no SRV records for 'test1.test.build.10gen.cc'> with backtrace:
               # ./lib/mongo/srv/resolver.rb:91:in `get_records'
               # ./lib/mongo/uri/srv_protocol.rb:152:in `parse!'
               # ./lib/mongo/uri.rb:298:in `initialize'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `new'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:992:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1042:in `block (5 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1042:in `block (4 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
               # /usr/share/ruby/timeout.rb:95:in `block in timeout'
               # /usr/share/ruby/timeout.rb:33:in `block in catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:110:in `timeout'
               # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
               # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
           # ./spec/mongo/uri/srv_protocol_spec.rb:1042:in `block (4 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
           # /usr/share/ruby/timeout.rb:95:in `block in timeout'
           # /usr/share/ruby/timeout.rb:33:in `block in catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:110:in `timeout'
           # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
           # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
        6) Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname has an empty last part it raises an error
           Failure/Error: expect { validate }.to raise_error(Mongo::Error::InvalidURI)
             expected Mongo::Error::InvalidURI, got #<Mongo::Error::NoSRVRecords: The DNS query returned no SRV records for 'test1.test.build.10gen.cc'> with backtrace:
               # ./lib/mongo/srv/resolver.rb:91:in `get_records'
               # ./lib/mongo/uri/srv_protocol.rb:152:in `parse!'
               # ./lib/mongo/uri.rb:298:in `initialize'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `new'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:992:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1052:in `block (5 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1052:in `block (4 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
               # /usr/share/ruby/timeout.rb:95:in `block in timeout'
               # /usr/share/ruby/timeout.rb:33:in `block in catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:110:in `timeout'
               # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
               # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
           # ./spec/mongo/uri/srv_protocol_spec.rb:1052:in `block (4 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
           # /usr/share/ruby/timeout.rb:95:in `block in timeout'
           # /usr/share/ruby/timeout.rb:33:in `block in catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:110:in `timeout'
           # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
           # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
        7) Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname contains a colon raises an error
           Failure/Error: expect { validate }.to raise_error(Mongo::Error::InvalidURI)
             expected Mongo::Error::InvalidURI, got #<Mongo::Error::NoSRVRecords: The DNS query returned no SRV records for 'test1.test.build.10gen.cc'> with backtrace:
               # ./lib/mongo/srv/resolver.rb:91:in `get_records'
               # ./lib/mongo/uri/srv_protocol.rb:152:in `parse!'
               # ./lib/mongo/uri.rb:298:in `initialize'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `new'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:992:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1070:in `block (5 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1070:in `block (4 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
               # /usr/share/ruby/timeout.rb:95:in `block in timeout'
               # /usr/share/ruby/timeout.rb:33:in `block in catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:110:in `timeout'
               # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
               # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
           # ./spec/mongo/uri/srv_protocol_spec.rb:1070:in `block (4 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
           # /usr/share/ruby/timeout.rb:95:in `block in timeout'
           # /usr/share/ruby/timeout.rb:33:in `block in catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:110:in `timeout'
           # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
           # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
        8) Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname starts with a dot raises an error
           Failure/Error: expect { validate }.to raise_error(Mongo::Error::InvalidURI)
             expected Mongo::Error::InvalidURI, got #<Mongo::Error::NoSRVRecords: The DNS query returned no SRV records for 'test1.test.build.10gen.cc'> with backtrace:
               # ./lib/mongo/srv/resolver.rb:91:in `get_records'
               # ./lib/mongo/uri/srv_protocol.rb:152:in `parse!'
               # ./lib/mongo/uri.rb:298:in `initialize'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `new'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:992:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1080:in `block (5 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1080:in `block (4 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
               # /usr/share/ruby/timeout.rb:95:in `block in timeout'
               # /usr/share/ruby/timeout.rb:33:in `block in catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:110:in `timeout'
               # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
               # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
           # ./spec/mongo/uri/srv_protocol_spec.rb:1080:in `block (4 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
           # /usr/share/ruby/timeout.rb:95:in `block in timeout'
           # /usr/share/ruby/timeout.rb:33:in `block in catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:110:in `timeout'
           # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
           # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
        9) Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname ends with consecutive dots raises an error
           Failure/Error: expect { validate }.to raise_error(Mongo::Error::InvalidURI)
             expected Mongo::Error::InvalidURI, got #<Mongo::Error::NoSRVRecords: The DNS query returned no SRV records for 'test1.test.build.10gen.cc'> with backtrace:
               # ./lib/mongo/srv/resolver.rb:91:in `get_records'
               # ./lib/mongo/uri/srv_protocol.rb:152:in `parse!'
               # ./lib/mongo/uri.rb:298:in `initialize'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `new'
               # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:992:in `block (3 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1090:in `block (5 levels) in <top (required)>'
               # ./spec/mongo/uri/srv_protocol_spec.rb:1090:in `block (4 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
               # /usr/share/ruby/timeout.rb:95:in `block in timeout'
               # /usr/share/ruby/timeout.rb:33:in `block in catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:33:in `catch'
               # /usr/share/ruby/timeout.rb:110:in `timeout'
               # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
               # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
               # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
           # ./spec/mongo/uri/srv_protocol_spec.rb:1090:in `block (4 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
           # /usr/share/ruby/timeout.rb:95:in `block in timeout'
           # /usr/share/ruby/timeout.rb:33:in `block in catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:33:in `catch'
           # /usr/share/ruby/timeout.rb:110:in `timeout'
           # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
           # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
           # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
        10) Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname contains consecutive dots in the middle raises an error
            Failure/Error: expect { validate }.to raise_error(Mongo::Error::InvalidURI)
              expected Mongo::Error::InvalidURI, got #<Mongo::Error::NoSRVRecords: The DNS query returned no SRV records for 'test1.test.build.10gen.cc'> with backtrace:
                # ./lib/mongo/srv/resolver.rb:91:in `get_records'
                # ./lib/mongo/uri/srv_protocol.rb:152:in `parse!'
                # ./lib/mongo/uri.rb:298:in `initialize'
                # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `new'
                # ./spec/mongo/uri/srv_protocol_spec.rb:988:in `block (3 levels) in <top (required)>'
                # ./spec/mongo/uri/srv_protocol_spec.rb:992:in `block (3 levels) in <top (required)>'
                # ./spec/mongo/uri/srv_protocol_spec.rb:1100:in `block (5 levels) in <top (required)>'
                # ./spec/mongo/uri/srv_protocol_spec.rb:1100:in `block (4 levels) in <top (required)>'
                # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
                # /usr/share/ruby/timeout.rb:95:in `block in timeout'
                # /usr/share/ruby/timeout.rb:33:in `block in catch'
                # /usr/share/ruby/timeout.rb:33:in `catch'
                # /usr/share/ruby/timeout.rb:33:in `catch'
                # /usr/share/ruby/timeout.rb:110:in `timeout'
                # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
                # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
                # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
            # ./spec/mongo/uri/srv_protocol_spec.rb:1100:in `block (4 levels) in <top (required)>'
            # ./spec/lite_spec_helper.rb:125:in `block (3 levels) in <top (required)>'
            # /usr/share/ruby/timeout.rb:95:in `block in timeout'
            # /usr/share/ruby/timeout.rb:33:in `block in catch'
            # /usr/share/ruby/timeout.rb:33:in `catch'
            # /usr/share/ruby/timeout.rb:33:in `catch'
            # /usr/share/ruby/timeout.rb:110:in `timeout'
            # ./spec/lite_spec_helper.rb:124:in `block (2 levels) in <top (required)>'
            # ./spec/lite_spec_helper.rb:107:in `block (2 levels) in <top (required)>'
            # ./spec/support/background_thread_registry.rb:62:in `block (2 levels) in <top (required)>'
      Finished in 8 minutes 6 seconds (files took 6.86 seconds to load)
      22011 examples, 10 failures, 9800 pending
      Failed examples:
      rspec ./spec/mongo/uri/srv_protocol_spec.rb:1000 # Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname is valid does not raise an error
      rspec ./spec/mongo/uri/srv_protocol_spec.rb:1010 # Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname has a trailing dot raises an error
      rspec ./spec/mongo/uri/srv_protocol_spec.rb:1020 # Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname is empty raises an error
      rspec ./spec/mongo/uri/srv_protocol_spec.rb:1030 # Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname has only one part raises an error
      rspec ./spec/mongo/uri/srv_protocol_spec.rb:1041 # Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname has only two parts raises an error
      rspec ./spec/mongo/uri/srv_protocol_spec.rb:1051 # Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname has an empty last part it raises an error
      rspec ./spec/mongo/uri/srv_protocol_spec.rb:1069 # Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname contains a colon raises an error
      rspec ./spec/mongo/uri/srv_protocol_spec.rb:1079 # Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname starts with a dot raises an error
      rspec ./spec/mongo/uri/srv_protocol_spec.rb:1089 # Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname ends with consecutive dots raises an error
      rspec ./spec/mongo/uri/srv_protocol_spec.rb:1099 # Mongo::URI::SRVProtocol#validate_srv_hostname when the hostname contains consecutive dots in the middle raises an error
      

      ./spec/mongo/uri/srv_protocol_spec.rb:988

          let(:dummy_uri) do
            Mongo::URI::SRVProtocol.new("mongodb+srv://test1.test.build.10gen.cc/")
          end
      

            Assignee:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Reporter:
            jaruga@redhat.com Jun Aruga
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: