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: improve flaky test-listen-fd-ebadf.js #17797

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
6 participants
@Trott
Copy link
Member

commented Dec 20, 2017

Find an invalid file descriptor rather than assuming 42 will be invalid.

Fixes: #17762

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test net

@Trott Trott added net test labels Dec 20, 2017

@Trott

This comment has been minimized.

Copy link
Member Author

commented Dec 20, 2017

Ping @gibfahn

@Trott

This comment has been minimized.

Copy link
Member Author

commented Dec 20, 2017

@gibfahn

This comment has been minimized.

Copy link
Member

commented Dec 20, 2017

Seems reasonable, let me try it on the machine that was failing.

@gibfahn

This comment has been minimized.

Copy link
Member

commented Dec 20, 2017

descripter -> descriptor in the commit message btw

test: improve flaky test-listen-fd-ebadf.js
Find an invalid file descriptor rather than assuming 42 will be invalid.

Fixes: #17762

@Trott Trott force-pushed the Trott:fix-flaky-ebadf branch from 0656a5b to b3c4365 Dec 20, 2017

@gibfahn

This comment has been minimized.

Copy link
Member

commented Dec 20, 2017

$ 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
@Trott

This comment has been minimized.

Copy link
Member Author

commented Dec 21, 2017

(CI issues are infra-related, unrelated to this PR.)

@lpinca

lpinca approved these changes Dec 21, 2017

@Trott

This comment has been minimized.

Copy link
Member Author

commented Dec 21, 2017

Landed in 1d87891

@Trott Trott closed this Dec 21, 2017

Trott added a commit to Trott/io.js that referenced this pull request Dec 21, 2017

test: improve flaky test-listen-fd-ebadf.js
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>

MylesBorins added a commit that referenced this pull request Jan 8, 2018

test: improve flaky test-listen-fd-ebadf.js
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>

MylesBorins added a commit that referenced this pull request Jan 9, 2018

test: improve flaky test-listen-fd-ebadf.js
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>

MylesBorins added a commit that referenced this pull request Jan 9, 2018

test: improve flaky test-listen-fd-ebadf.js
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>

@MylesBorins MylesBorins referenced this pull request Jan 10, 2018

Merged

v9.4.0 proposal #18069

gibfahn added a commit that referenced this pull request Jan 24, 2018

test: improve flaky test-listen-fd-ebadf.js
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 gibfahn added land-on-v8.x and removed lts-watch-v8.x labels Jan 24, 2018

@gibfahn

This comment has been minimized.

Copy link
Member

commented Jan 24, 2018

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) {

gibfahn added a commit that referenced this pull request Jan 24, 2018

test: improve flaky test-listen-fd-ebadf.js
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 added a commit that referenced this pull request Jan 24, 2018

test: improve flaky test-listen-fd-ebadf.js
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>
@Trott

This comment has been minimized.

Copy link
Member Author

commented Jan 25, 2018

@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!

Trott added a commit to Trott/io.js that referenced this pull request Jan 25, 2018

test: improve flaky test-listen-fd-ebadf.js
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>

@Trott Trott referenced this pull request Jan 25, 2018

Closed

[v6.x backport] test: improve flaky test-listen-fd-ebadf.js #18362

2 of 2 tasks complete
@Trott

This comment has been minimized.

Copy link
Member Author

commented Jan 25, 2018

@gibfahn Backport in #18362.

msoechting added a commit to hpicgs/node that referenced this pull request Feb 5, 2018

test: improve flaky test-listen-fd-ebadf.js
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>

MylesBorins added a commit that referenced this pull request Feb 5, 2018

test: improve flaky test-listen-fd-ebadf.js
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>

@MylesBorins MylesBorins referenced this pull request Feb 7, 2018

Merged

v6.13.0 proposal #18342

msoechting added a commit to hpicgs/node that referenced this pull request Feb 7, 2018

test: improve flaky test-listen-fd-ebadf.js
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>

MylesBorins added a commit that referenced this pull request Feb 11, 2018

test: improve flaky test-listen-fd-ebadf.js
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>

MylesBorins added a commit that referenced this pull request Feb 12, 2018

test: improve flaky test-listen-fd-ebadf.js
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>

MylesBorins added a commit that referenced this pull request Feb 12, 2018

test: improve flaky test-listen-fd-ebadf.js
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>

MylesBorins added a commit that referenced this pull request Feb 13, 2018

test: improve flaky test-listen-fd-ebadf.js
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.