You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
net/http: TestTransportDialTLSContext flakes in local testing #59035
A connection to #57475 doesn't seem likely to me. That test uses test hooks to force a timeout, and those failures were about a forced timeout not happening as fast as expected. This test is not using test hooks and appears to be making real network connections.
This made me think of #37795, although the setup is a bit different and I don't think that precise bug should apply here.
I ran the test case from #37795 (comment) to see if the underlying macOS bug causing #37795 still exists. This test consists of a C client and server. The client loops, connecting to the server and immediately closing each connection. The server accepts connections, attempts to read one byte (returning EOF), and then closes the connection. Previously, this test would hang in the read.
The read timeout seems to be fixed, but the client in this test now hangs for me after a few iterations, returning ETIMEDOUT from connect. That seems like the same behavior seen in the flake here.
Not sure yet if this is a kernel bug or something else (port exhaustion? antivirus getting out of hand?).
Run the server. Run the client. The client makes connections to the server and closes them, with a delay every 100 connections to avoid ephemeral port exhaustion. After a while (seems to take ~16,000 connection attempts for me, so 2-3 minutes) the client's connect call fails with ETIMEDOUT.
I ran this on my Google-issued laptop and got the failure, but I've been unable to reproduce it on my personal MacBook Pro. It's possible this one is due to some non-standard antivirus or firewall on the Google laptop.
Activity
bcmills commentedon Mar 14, 2023
#57475 may be related.
bcmills commentedon Mar 14, 2023
ianlancetaylor commentedon Mar 15, 2023
A connection to #57475 doesn't seem likely to me. That test uses test hooks to force a timeout, and those failures were about a forced timeout not happening as fast as expected. This test is not using test hooks and appears to be making real network connections.
neild commentedon Mar 15, 2023
I can replicate this on my laptop (darwin-arm64), but not on linux-amd64. Not sure about root cause, but I suspect something platform specific.
neild commentedon Mar 15, 2023
This made me think of #37795, although the setup is a bit different and I don't think that precise bug should apply here.
I ran the test case from #37795 (comment) to see if the underlying macOS bug causing #37795 still exists. This test consists of a C client and server. The client loops, connecting to the server and immediately closing each connection. The server accepts connections, attempts to read one byte (returning EOF), and then closes the connection. Previously, this test would hang in the read.
The read timeout seems to be fixed, but the client in this test now hangs for me after a few iterations, returning ETIMEDOUT from connect. That seems like the same behavior seen in the flake here.
Not sure yet if this is a kernel bug or something else (port exhaustion? antivirus getting out of hand?).
neild commentedon Mar 15, 2023
I thought this might be port exhaustion, but that doesn't appear the case.
I can reproduce what appears to be the same issue using a pair of C programs (small variant from the ones in #37795).
Client:
Server:
Run the server. Run the client. The client makes connections to the server and closes them, with a delay every 100 connections to avoid ephemeral port exhaustion. After a while (seems to take ~16,000 connection attempts for me, so 2-3 minutes) the client's
connectcall fails withETIMEDOUT.rsc commentedon Mar 16, 2023
I ran this on my Google-issued laptop and got the failure, but I've been unable to reproduce it on my personal MacBook Pro. It's possible this one is due to some non-standard antivirus or firewall on the Google laptop.