Add capacity to mock commands run on DBDirectClient

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Serverless
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      ShardSplitDonorService uses DBDirectClient for operations such as `replSetReconfig`. This forces us to define a mock "replSetReconfig" command globally within `shard_split_donor_service_test.cpp`, otherwise this command does not exist and the test fails.

       

      This could create issues is the real implementation of "replSetReconfig" is linked (multiple registration of the same commands) or if the mock cause unintended behavior in other test (registration is global, it can't be turned on/off depending on the test).

       

      MockRemoteDBServer provides a `setCommandReply` interface that seemed promising, but it can't be used as DBDirectClient does not invoke MockRemoteDBServer and does it work locally instead. Furthermore the `setCommandReply` does not provide the ability to check the command has been called, or with which arguments.

       

      We want to be able to mock commands with some granularity control and with the capacity to check its input/validate it's been called.

            Assignee:
            [DO NOT USE] Backlog - Server Serverless (Inactive)
            Reporter:
            Didier Nadeau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: