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

Global registry of clients in test suite

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.7.0.rc0
    • Affects Version/s: None
    • Component/s: Tests
    • Labels:
      None

      When we are testing SDAM, it is important to not have background threads from global clients and clients created by previously executing tests get in the way of the current test. This requires at a minimum suspending background monitoring of all outstanding clients. As there is utility in sharing client instances between tests, this ticket proposes to:

      1. Add a global registry (glorified array) of mongo clients.
      2. Replace all Mongo::Client.new calls with a helper invocation that adds the created client to the registry.
      3. Add a helper method that kills background monitoring threads of all active clients. I believe calling `disconnect` would accomplish this.
      4. Adds a helper method that reinstates background monitoring threads, such as by calling `reconnect`.

      This also paves way for automatically cleaning up all clients created by individual test cases, if we mark the global clients specially.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: