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: decrease duration of test-cli-syntax #14187

Closed
wants to merge 1 commit into from

Conversation

evanlucas
Copy link
Contributor

Previously, test/parallel/test-cli-syntax.js was spawning a lot of child
processes, but using spawnSync, which made the test run each child
process serially. This switches most of the test cases to use exec so
that they are asynchronous. Locally, the test went from > 5 seconds to
under 2 seconds.

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

test

Previously, test/parallel/test-cli-syntax.js was spawning a lot of child
processes, but using spawnSync, which made the test run each child
process serially. This switches most of the test cases to use exec so
that they are asynchronous. Locally, the test went from > 5 seconds to
under 2 seconds.
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Jul 12, 2017
@evanlucas
Copy link
Contributor Author

@mscdex mscdex added the cli Issues and PRs related to the Node.js command line interface. label Jul 12, 2017
Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mhdawson
Copy link
Member

Like the other changes to address the slowdown caused by disabling snapshots I'd suggest we expedite landing this one as well.

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if CI is green.

Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 Nit

@@ -2,7 +2,7 @@

const common = require('../common');
const assert = require('assert');
const spawnSync = require('child_process').spawnSync;
const {exec, spawnSync} = require('child_process');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space inside the curly braces #14162

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that a lint rule? If so, when did that change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that a lint rule? If so, when did that change?

about to land...

@refack
Copy link
Contributor

refack commented Jul 12, 2017

Why not refactor the other two uses of spawnSync?

@evanlucas
Copy link
Contributor Author

@refack they use spawnSync's input option which writes stdin to the process.

@evanlucas
Copy link
Contributor Author

Trying CI one more time https://ci.nodejs.org/job/node-test-pull-request/9108/

@mhdawson
Copy link
Member

CI was good landing.

@mhdawson
Copy link
Member

Landed as a74ddff

@mhdawson mhdawson closed this Jul 13, 2017
mhdawson pushed a commit that referenced this pull request Jul 13, 2017
Previously, test/parallel/test-cli-syntax.js was spawning a lot of child
processes, but using spawnSync, which made the test run each child
process serially. This switches most of the test cases to use exec so
that they are asynchronous. Locally, the test went from > 5 seconds to
under 2 seconds.

PR-URL: #14187
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
@evanlucas
Copy link
Contributor Author

Ah thanks @mhdawson. I meant to land this morning but forgot about it. :]

@evanlucas evanlucas deleted the testclisyntax branch July 13, 2017 22:54
@addaleax addaleax mentioned this pull request Jul 18, 2017
addaleax pushed a commit that referenced this pull request Jul 18, 2017
Previously, test/parallel/test-cli-syntax.js was spawning a lot of child
processes, but using spawnSync, which made the test run each child
process serially. This switches most of the test cases to use exec so
that they are asynchronous. Locally, the test went from > 5 seconds to
under 2 seconds.

PR-URL: #14187
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Fishrock123 pushed a commit that referenced this pull request Jul 19, 2017
Previously, test/parallel/test-cli-syntax.js was spawning a lot of child
processes, but using spawnSync, which made the test run each child
process serially. This switches most of the test cases to use exec so
that they are asynchronous. Locally, the test went from > 5 seconds to
under 2 seconds.

PR-URL: #14187
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
@MylesBorins
Copy link
Contributor

This does not land cleanly in LTS. Please feel free to manually backport by following the guide. Please also feel free to replace do-not-land if it is being backported

MylesBorins pushed a commit that referenced this pull request Feb 13, 2018
Previously, test/parallel/test-cli-syntax.js was spawning a lot of child
processes, but using spawnSync, which made the test run each child
process serially. This switches most of the test cases to use exec so
that they are asynchronous. Locally, the test went from > 5 seconds to
under 2 seconds.

PR-URL: #14187
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issues and PRs related to the Node.js command line interface. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants