Unfortunately the sleeping required to make the timeout trigger is not mockable: that’s the reason for making the ugly 2 ms real sleep opt-in via the environment variable FUZZED_SOCKET_FAKE_LATENCY
. That environment is not assumed to be set except in special circumstances such as when targeted fuzzing is performed by security researchers and others who are willing to pay the 2 ms cost in order to get full coverage including the timeout logic.
Making the sleeping required to trigger the timeout mockable is likely out of scope for this PR (but would be nice to have!), so if the opt-in-to-timeout-via-FUZZED_SOCKET_FAKE_LATENCY
workaround is deemed too ugly I could simply drop that commit from this PR, and we’ll get partial instead of full coverage :)
Let me know what you think and I’ll adjust accordingly :)