Implement static variable reset to allow for multiple extension loads in the same unit test fixture

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • ALL
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, in load_extension_test.cpp, you can only load an extension once in the entire test suite.  You cannot write multiple tests that load the same extension, because it is already loaded.

      The workaround for SERVER-108454 was to just create the $testBar and $testBuzz extensions. However, this is not scalable/efficient in the long run.

      We should be able to reset all state (similar to unregisterParser_forTest) in between all unit tests, so that each unit test can simulate a clean-slate working environment.

      I attempted to do this and added a `reset()` function onto the ExtensionLoader to clear the loadedExtensions map, but ran into an issue because LiteParsedDocumentSource adds a metric for each new stage here, and there's no easy way of clearing added metrics.

      Once we complete this, we can remove the $testBar and $testBuzz extensions.

              Assignee:
              Unassigned
              Reporter:
              Finley Lau
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: