test: add mustCall() to child-process test#13605
Closed
Trott wants to merge 1 commit intonodejs:masterfrom
Closed
Conversation
Add common.mustCall() check to test-child-process-stdio-big-write-end.
lpinca
approved these changes
Jun 11, 2017
refack
approved these changes
Jun 11, 2017
refack
reviewed
Jun 11, 2017
| @@ -43,10 +43,10 @@ function parent() { | |||
| child.stdout.on('data', function(c) { | |||
Contributor
There was a problem hiding this comment.
How about adding a mustCallAtLeast?
(I see that the value of n is asserted, but this will give a one-step-closer-to-root-cause assertion error)
Member
Author
There was a problem hiding this comment.
If I understand correctly, the assertion on n will occur before any assertion by mustCallAtLeast().
cjihrig
approved these changes
Jun 11, 2017
refack
approved these changes
Jun 11, 2017
| @@ -43,10 +43,10 @@ function parent() { | |||
| child.stdout.on('data', function(c) { | |||
| child.stdout.on('end', function() { | ||
| child.stdout.on('end', common.mustCall(function() { | ||
| assert.strictEqual(+n, sent); | ||
| console.log('ok'); |
Contributor
There was a problem hiding this comment.
Should remove (maybe replace with comment // end of test)
| }); | ||
| child.stdout.on('end', function() { | ||
| child.stdout.on('end', common.mustCall(function() { | ||
| assert.strictEqual(+n, sent); |
Contributor
There was a problem hiding this comment.
the + is cheating the strict
either put on the right side send + '\n' ('\n' is because data comes from console.log)
or replace the 'data' handler with:
let n = 0;
child.stdout.setEncoding('ascii');
child.stdout.on('data', function(d) {
const c = Number(d);
if (!c) assert.fail(c);
n += c;
});
hiroppy
approved these changes
Jun 12, 2017
tniessen
approved these changes
Jun 12, 2017
jasnell
approved these changes
Jun 12, 2017
Member
Author
jasnell
pushed a commit
that referenced
this pull request
Jun 13, 2017
Add common.mustCall() check to test-child-process-stdio-big-write-end. PR-URL: #13605 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Member
|
Landed in f308b4d |
addaleax
pushed a commit
that referenced
this pull request
Jun 17, 2017
Add common.mustCall() check to test-child-process-stdio-big-write-end. PR-URL: #13605 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Merged
addaleax
pushed a commit
that referenced
this pull request
Jun 21, 2017
Add common.mustCall() check to test-child-process-stdio-big-write-end. PR-URL: #13605 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Merged
MylesBorins
pushed a commit
that referenced
this pull request
Aug 14, 2017
Add common.mustCall() check to test-child-process-stdio-big-write-end. PR-URL: #13605 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Aug 16, 2017
Add common.mustCall() check to test-child-process-stdio-big-write-end. PR-URL: #13605 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Merged
This was referenced Sep 5, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add common.mustCall() check to test-child-process-stdio-big-write-end.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test child_process