Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2534

Add test overrides for connect and recv to allow configurable delays

    • Type: Icon: Improvement Improvement
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • 1.10.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      The implementation of IPv6 (CDRIVER-1972) first tries connecting with IPv6, and if the connect call has not completed by 250ms the connection for IPv4 is started.

      When testing, we needed to simulate the behavior of a connect call not completing for some delay. The current solution is to have a the mock server bind to a port, and delay before calling listen. This prevents the client connect from completing, but does not refuse the connection on macOS. On Linux this doesn't work, and instead clients are refused immediately while the server is not listening.

      An alternative is to use LD_PRELOAD hooks to swap out connect() and recv() with functions that have configurable delays. See Initial DNS Seedlist Discovery tests for more info on using LD_PRELOAD

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: