Refactor query stats read errors unit tests

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Clean up query_stats_store_test.cpp after all read errors unit tests are added.

      Some things to clean up:

      • Add a QueryStatsErrorsTest : QueryStatsStoreTest fixture holding the flag guard as a member so unittest::ServerParameterGuard errorsEnabled("featureFlagQueryStatsErrors", true) isn't repeated
      • If SERVER-131927 changes makeFindKeyFromQuery to return unique_ptr<key> instead of const key, then the lambda on 344-347 can be removed (currently builds the key twice - once to hash and once to pass into writeQueryStats. That was a workaround for makeFindKeyFromQuery returning unique_ptr<const Key
      • Add assertErrorState(entry, {execCountErrored, numRecentErrors, code}) to remove duplicated execCountErrored / recentErrors.size() / recentErrors.hasKey() checks

            Assignee:
            Unassigned
            Reporter:
            Kritika Singh (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: