[CDRIVER-2534] Add test overrides for connect and recv to allow configurable delays Created: 07/Mar/18  Updated: 27/Oct/23  Resolved: 08/Mar/18

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.10.0

Type: Improvement Priority: Major - P3
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-1972 Support IPv6 only hostnames Closed

 Description   

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



 Comments   
Comment by A. Jesse Jiryu Davis [ 08/Mar/18 ]

We found a better idea, replacing the "poll" implementation within the relevant tests.

Generated at Wed Feb 07 21:15:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.