-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: run tests even if os.cpus() fails #9616
Conversation
@@ -32,7 +32,7 @@ exports.isOSX = process.platform === 'darwin'; | |||
exports.enoughTestMem = os.totalmem() > 0x40000000; /* 1 Gb */ | |||
|
|||
const cpus = os.cpus(); | |||
exports.enoughTestCpu = cpus.length > 1 || cpus[0].speed > 999; | |||
exports.enoughTestCpu = cpus != undefined && (cpus.length > 1 || cpus[0].speed > 999); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bnoordhuis updated, PTAL.
49e5599
to
aa11cd4
Compare
@@ -32,7 +32,8 @@ exports.isOSX = process.platform === 'darwin'; | |||
exports.enoughTestMem = os.totalmem() > 0x40000000; /* 1 Gb */ | |||
|
|||
const cpus = os.cpus(); | |||
exports.enoughTestCpu = cpus.length > 1 || cpus[0].speed > 999; | |||
exports.enoughTestCpu = cpus != undefined && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using Array.isArray(cpus)
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc/ @Trott
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with an optional tiny nit.
Currently if the os.cpus() call fails every test will fail. As there is already a test for os.cpus(), the other tests should run even if the os.cpus() call fails.
aa11cd4
to
a3d5d4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CI the second: https://ci.nodejs.org/view/Node.js/job/node-test-pull-request/4854/ EDIT: CI was good except for this inspector test failure on windows (which I'm pretty sure is unrelated):
|
Currently if the os.cpus() call fails every test will fail. As there is already a test for os.cpus(), the other tests should run even if the os.cpus() call fails. PR-URL: #9616 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 0619896 |
Currently if the os.cpus() call fails every test will fail. As there is already a test for os.cpus(), the other tests should run even if the os.cpus() call fails. PR-URL: #9616 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Currently if the os.cpus() call fails every test will fail. As there is already a test for os.cpus(), the other tests should run even if the os.cpus() call fails. PR-URL: nodejs#9616 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Currently if the os.cpus() call fails every test will fail. As there is already a test for os.cpus(), the other tests should run even if the os.cpus() call fails. PR-URL: #9616 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
Description of change
Currently if the os.cpus() call fails every test will fail. As there is
already a test for os.cpus(), the other tests should run even if the
os.cpus() call fails.