[SERVER-45603] Enhance MockDBClientConnection for OplogFetcher unit testing Created: 16/Jan/20  Updated: 29/Oct/23  Resolved: 17/Jan/20

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.3.3

Type: Task Priority: Major - P3
Reporter: Lingzhi Deng Assignee: Lingzhi Deng
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split from SERVER-45431 Create new test fixture for OplogFetcher Closed
Backwards Compatibility: Fully Compatible
Sprint: Repl 2020-01-27
Participants:

 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


 Comments   
Comment by Githook User [ 17/Jan/20 ]

Author:

{'username': 'ldennis', 'name': 'Lingzhi Deng', 'email': 'lingzhi.deng@mongodb.com'}

Message: SERVER-45603: Enhance MockDBClientConnection for OplogFetcher unit testing
Branch: master
https://github.com/mongodb/mongo/commit/a059b32452e7a5775e60c1b616249cf4dec438a9

Generated at Thu Feb 08 05:09:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.