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

Enhance MockDBClientConnection for OplogFetcher unit testing

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.3
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Repl 2020-01-27

      Description

      After SERVER-45468, the new OplogFetcher will be using DBClientConnection and DBClientCursor for oplog fetching. In order to convert the unit tests, we need a way to intercept outgoing client requests and to simulate network responses.

      The MockDBClientConnection already implements the query and runCommandWithTarget mock, which are used by the initial sync cloner tests. But for the new OplogFetcher, it doesn't use these APIs. For oplog fetching using exhaust cursors, it mostly uses the call() and recv() APIs.

      So in this ticket, we will implement call() and recv() so that we can:

      • intercept outgoing client requests
      • simulate network responses (for both call() and recv())
      • allow network operations be blocked waiting for mock responses
      • know if the MockDBClientConnection is blocked on network operations

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lingzhi.deng Lingzhi Deng
              Reporter:
              lingzhi.deng Lingzhi Deng
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: