-
Notifications
You must be signed in to change notification settings - Fork 30k
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: improve flaky test-listen-fd-ebadf.js #17797
Conversation
Ping @gibfahn |
Seems reasonable, let me try it on the machine that was failing. |
descripter -> descriptor in the commit message btw |
Find an invalid file descriptor rather than assuming 42 will be invalid. Fixes: nodejs#17762
0656a5b
to
b3c4365
Compare
$ tools/test.py -J --repeat 1000 parallel/test-listen-fd-ebadf
Command: out/Release/node /dev/shm/gib/node/test/parallel/test-listen-fd-ebadf.js
[00:08|% 100|+ 980|- 20]: Done
$ tools/test.py -J --repeat 1000 parallel/test-listen-fd-ebadf-trott
[00:08|% 100|+ 1000|- 0]: Done Looks like that fixes it, thanks @Trott ! EDIT: Since the machine is idle, why not do a proper stress test: $ tools/test.py -J --repeat 100000 parallel/test-listen-fd-ebadf-trott
[25:31|% 100|+ 100000|- 0]: Done |
(CI issues are infra-related, unrelated to this PR.) |
Landed in 1d87891 |
Find an invalid file descriptor rather than assuming 42 will be invalid. PR-URL: nodejs#17797 Fixes: nodejs#17762 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Find an invalid file descriptor rather than assuming 42 will be invalid. PR-URL: #17797 Fixes: #17762 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Find an invalid file descriptor rather than assuming 42 will be invalid. PR-URL: #17797 Fixes: #17762 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Find an invalid file descriptor rather than assuming 42 will be invalid. PR-URL: #17797 Fixes: #17762 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Find an invalid file descriptor rather than assuming 42 will be invalid. PR-URL: #17797 Fixes: #17762 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Doesn't land cleanly on 6.x. Assuming this test is flaky there too, a backport would be useful. Diff: diff --git a/test/parallel/test-listen-fd-ebadf.js b/test/parallel/test-listen-fd-ebadf.js
index dfa99e274a..8153803e30 100644
--- a/test/parallel/test-listen-fd-ebadf.js
+++ b/test/parallel/test-listen-fd-ebadf.js
@@ -1,11 +1,29 @@
'use strict';
const common = require('../common');
+
const assert = require('assert');
+const fs = require('fs');
const net = require('net');
net.createServer(common.mustNotCall()).listen({fd: 2})
.on('error', common.mustCall(onError));
+<<<<<<< HEAD
net.createServer(common.mustNotCall()).listen({fd: 42})
+||||||| parent of 1d8789188f... test: improve flaky test-listen-fd-ebadf.js
+net.createServer(common.mustNotCall()).listen({ fd: 42 })
+=======
+
+let invalidFd = 2;
+
+// Get first known bad file descriptor.
+try {
+ while (fs.fstatSync(++invalidFd));
+} catch (e) {
+ // do nothing; we now have an invalid fd
+}
+
+net.createServer(common.mustNotCall()).listen({ fd: invalidFd })
+>>>>>>> 1d8789188f... test: improve flaky test-listen-fd-ebadf.js
.on('error', common.mustCall(onError));
function onError(ex) { |
Find an invalid file descriptor rather than assuming 42 will be invalid. PR-URL: #17797 Fixes: #17762 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@gibfahn Merge conflict is caused by #14162 which added whitespace but hasn't yet been backported. Backport was requested in October so I guess it's not coming. That's unfortunate, because all those whitespace changes are likely to cause further merge conflicts. Oh well. At least it's easy to resolve: Remove the line from HEAD and keep all the lines from this PR. Done! |
Find an invalid file descriptor rather than assuming 42 will be invalid. PR-URL: nodejs#17797 Fixes: nodejs#17762 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Find an invalid file descriptor rather than assuming 42 will be invalid. PR-URL: #17797 Fixes: #17762 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Find an invalid file descriptor rather than assuming 42 will be invalid. PR-URL: #17797 Fixes: #17762 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Find an invalid file descriptor rather than assuming 42 will be invalid. PR-URL: #17797 Fixes: #17762 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Find an invalid file descriptor rather than assuming 42 will be invalid. PR-URL: #17797 Fixes: #17762 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Find an invalid file descriptor rather than assuming 42 will be invalid.
Fixes: #17762
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test net