New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/nettest: TestPipeTimeout occasional failure on Windows #873
Comments
/cc @josharian |
I can't reproduce here after 50k runs, so it does seem to be Windows-only. But there's no Windows-specific code (or OS-specific code) I see anywhere in that package. That's quite disconcerting. Can anyone running Windows reproduce locally, or is this GitHub-only? |
@josharian I just run this:
Am I doing it correctly? Alex |
Thanks, @alexbrainman. Would you test |
Oops. Still passes here against your #1141
|
Thanks, Alex. Sadly, my #1141 also keeps passing. :( |
I have a theory: Windows has low resolution timers. We expect a timeout here:
but we don't get it, because time.Now == p.writeTimeout. Fix is !time.Now().Before(p.writeTimeout). Testing out that theory... |
Windows has a low resolution timer. Some of the tests assumed that unblock takes effect immediately. Consider: t := time.Now() elapsed := time.Now().After(t) It seems plausible that elapsed should always be true. However, with a low resolution timer, that might fail. Change time.Now().After to !time.Now().Before, so that unblocking always takes effect immediately. Fixes #873.
That was it. Fix and details (and other improvements) in #1141. |
@crawshaw, any idea?
The text was updated successfully, but these errors were encountered: