[TEST][NO-MERGE] Stress test sockets #381
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It's found that the
nc
based communication introduced in #367, while more reliable than the named-pipe based communication, can still get stuck or have mismatched messages occasionally during 100k runs.Out of 100k runs, we had 8 timeouts, 20 empty responses, and 4 Bad Request response as shown below. This is better than with named pipes (70 timeouts out of 100k times) but still pretty unreliable.
Moreover, sometimes the returned message is pretty confusing:
The same test (with
nc -N
) can pass on Linux (Ubuntu 20.04.6 LTS, Xeon(R) Platinum 8375C).Port conflict
It turns out that on macOS (14.6.1, M2 Max), new ServerSocket(0) (or Python
sock.bind(('', 0))
) might return a port already in use by another process (even those already for a while, so not a race condition in allocation). This can be confirmed withSuch commands can succeed with no conflict found on Linux (Ubuntu 20.04.6 LTS, Xeon(R) Platinum 8375C).
Pop-up
There are reports that
nc
(invoked from Bazel) can trigger a pop-up on macOS "Do you want the application "nc" to accept incoming network connections?" or fail withnc: connectx to 127.0.0.1 port 59416 (tcp) failed: Operation not permitted
. It's not clear how to reliably reproduce this issue.