Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5598

Fix transient spec failure in spec/mongoid/clients/options_spec.rb

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 9.0.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Refer to https://github.com/mongodb/mongoid/pull/5597/files

      There is a spec in the file spec/mongoid/clients/options_spec.rb that makes an assertion about the number of DB connections, by asking the DB for the number of connections it has.

      The spec is set to retry 3 times (a red flag that it's janky) and even with these retries, it still fails about 1 out of every 10 times. Its easy to repro locally using 100.times { } around the spec.

      The PR, I've made a fix which preserves the spirit of the test in the way that doesn't fail--ran it 1000 times without retries and it worked every time.

            Assignee:
            jamis.buck@mongodb.com Jamis Buck
            Reporter:
            shields@tablecheck.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: