Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-64136

Add capacity to mock commands run on DBDirectClient

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Serverless

    Description

      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.

      Attachments

        Activity

          People

            backlog-server-serverless [DO NOT USE] Backlog - Server Serverless (Inactive)
            didier.nadeau@mongodb.com Didier Nadeau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: