Details
-
Task
-
Resolution: Won't Fix
-
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.