• Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Networking & Observability

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: