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

Enhance MockDBClientConnection for OplogFetcher unit testing

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.3
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Fully Compatible
    • Repl 2020-01-27

      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

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

              Created:
              Updated:
              Resolved: