Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2876

Automatically clean up "mtest" resources

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.13.0, 1.13.1
    • Affects Version/s: None
    • Component/s: Testing
    • Labels:
      None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Currently all tests must run defer mt.Close after calling mtest.New to make sure mtest cleans up all of the server-side resources it created to run the test. That pattern is error-prone, possibly leading to tests that don't clean up server-side resources.

      Instead, we should make the cleanup process automatic by using T.Cleanup and remove mt.Close.

      Definition of done:

      • Register the mtest cleanup logic as an automatic test cleanup task using T.Cleanup.
      • Remove the mtest.T.Close function and all references.

            Assignee:
            matt.dale@mongodb.com Matt Dale
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: