-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Networking & Observability
-
200
The primary way of mocking network responses is through NetworkInterfaceMock, which is provided to the task executors used in various tests (the ShardingTestFixture is one such example). The NetworkInterfaceMock allows for fully deterministic simulations of the networking reactor thread and its sequencing with ThreadPoolTaskExecutor's executor thread, but as a result using it is quite difficult. In particular, the requirement to explicitly move the networking thread forward in the unittest main thread often bleeds implementations details of the TaskExecutor or its users to the test. For example, many tests needed to be updated to do so as a result of an internal refactor to ThreadPoolTaskExecutor in SERVER-93114 (see here).
We should provide a simpler way to use NetworkInterfaceMock, or introduce a simpler networking mock altogether for use in new tests.
- is related to
-
SERVER-92816 Add CancellationToken support to NetworkInterfaceTL::startCommand
- Closed
- related to
-
SERVER-93114 Update NetworkInterface::startExhaustCommand to return an ExhaustResponseReader
- Closed