Skip to content
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

test: fix race in test-net-socket-local-address #4052

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Nov 27, 2015

test-net-socket-local-address had a race condition that resulted in
unreliability on FreeBSD. This changes fixes the issue.

Fixes: #2475

test-net-socket-local-address had a race condition that resulted in
unreliability on FreeBSD. This changes fixes the issue.

Fixes: nodejs#2475
@Trott Trott added test Issues and PRs related to the tests. freebsd Issues and PRs related to the FreeBSD platform. labels Nov 27, 2015
@evanlucas
Copy link
Contributor

LGTM if CI is happy

@Trott
Copy link
Member Author

Trott commented Nov 27, 2015

Here's 28 failures in 129 runs of the test without this fix on FreeBSD: https://ci.nodejs.org/job/node-test-commit-freebsd/437/nodes=freebsd102-64/console

And here's 10000 successful runs without a single failure with this fix on FreeBSD: https://ci.nodejs.org/job/node-test-commit-freebsd/436/nodes=freebsd102-64/console

@mscdex mscdex added the net Issues and PRs related to the net subsystem. label Nov 27, 2015
@Trott
Copy link
Member Author

Trott commented Nov 27, 2015

@jbergstroem
Copy link
Member

LGTM. One less flaky test \o/

@Trott
Copy link
Member Author

Trott commented Nov 28, 2015

Looks like this one is also currently flaky on Windows, so this fix isn't just for FreeBSD's benefit. Woot.

https://ci.nodejs.org/job/node-test-binary-windows/163/RUN_SUBSET=3,VS_VERSION=vs2015,label=win2012r2/tapTestReport/test.tap-142/

@bnoordhuis
Copy link
Member

I don't understand where the race condition comes from. Does a 'close' event get lost somehow?

@Trott
Copy link
Member Author

Trott commented Nov 28, 2015

@bnoordhuis Either a server close event got lost or else it was just that the client close was firing new testConnect() connections before the server close event fired and caught up the conns count to know when to stop things. This happened infrequently and apparently only on FreeBSD. But it was enough to make the test flaky on FreeBSD.

@Trott
Copy link
Member Author

Trott commented Nov 28, 2015

Continues to afflict Windows without this fix: https://ci.nodejs.org/job/node-test-binary-windows/165/RUN_SUBSET=3,VS_VERSION=vs2015,label=win2012r2/tapTestReport/test.tap-142/

Guess I better run a stress test on Windows with this fix to make sure it works there too. (I had only run it on FreeBSD before.): https://ci.nodejs.org/job/node-stress-single-test/73/nodes=win2012r2/console

@Trott
Copy link
Member Author

Trott commented Nov 30, 2015

Stress test worked out A-OK on Windows. Seems ready to land, unless...

@bnoordhuis Was your question just a question or an expression of concern that my response doesn't adequately address? I'd like to land this if it was just the former, but will hold off if the latter.

@bnoordhuis
Copy link
Member

I had a look at the test and I believe there is a simpler way to fix the flakiness: #4078

@Trott
Copy link
Member Author

Trott commented Dec 1, 2015

Simpler solution in #4078 appears to solve the problem for Windows but not FreeBSD. Details over there. Maybe it just needs a small tweak or something.

@Trott
Copy link
Member Author

Trott commented Dec 1, 2015

Alternate solution that doesn't involve creating a Boolean and adding special logic based on it: #4109 Yay, three competing PRs!

@Trott
Copy link
Member Author

Trott commented Dec 2, 2015

Closing in favor of #4109

@Trott Trott closed this Dec 2, 2015
@Trott Trott deleted the fix-race branch January 13, 2022 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
freebsd Issues and PRs related to the FreeBSD platform. net Issues and PRs related to the net subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate flaky test test-net-socket-local-address
5 participants