-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Fix 11826 #11920
Fix 11826 #11920
Conversation
Perhaps it would be better to combine all of the tests (including the |
Yeah I don't agree with that PR's test splitting either. It's quite unnecessary IMHO. All that's needed is to run each test sequentially instead of in parallel. This can be done quite easily by actually keeping the |
Can you please add documentation for the new |
Shouldn't this delete the existing test file as it is being replaced by 13 individual test files? |
@mscdex wrote:
Maybe it would be good for @nodejs/testing to reconvene and try to come up with some test organization guidelines that might be useful in cases like this. I personally prefer lots of short test files that are very specific over long and monolithic test files that are more likely to have tests suffer from side effects from other tests in the file and so on. But this file isn't that long to begin with so ¯\(ツ)/¯. |
test/README.md
Outdated
@@ -410,6 +410,10 @@ The realpath of the 'tmp' directory. | |||
|
|||
Name of the temp directory used by tests. | |||
|
|||
### childShouldNotThrowAndAbort |
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.
Nit: should be childShouldNotThrowAndAbort()
test/common.js
Outdated
const child = child_process.exec(testCmd); | ||
child.on('exit', (code, signal) => { | ||
const errorMsg = `Test should have exited with exit code 0 | ||
but insteand exited with code ${code} and signal ${signal}`; |
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.
The multiline string literal is likely going to be problematic because the additional whitespace is preserved. Can you make this the following instead:
const errorMessage = 'Test should have exited with exit code 0 but instead ' +
`exited with ${code} and signal ${signal}`;
Generally speaking we do not use multiline string literals in core code
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.
@jasnell Is that extra indentation unintentional?
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.
no, not intentional on the extra indentation.
test/README.md
Outdated
@@ -410,6 +410,10 @@ The realpath of the 'tmp' directory. | |||
|
|||
Name of the temp directory used by tests. | |||
|
|||
### childShouldNotThrowAndAbort | |||
This test makes sure that when using --abort-on-uncaught-exception and when throwing an error |
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.
--abort-on-uncaught-exception
should be in backticks I think.
test/common.js
Outdated
@@ -250,6 +250,28 @@ exports.childShouldThrowAndAbort = function() { | |||
}); | |||
}; | |||
|
|||
|
|||
// This test makes sure that when using --abort-on-uncaught-exception and |
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.
s/test/function/
I have the changes as suggested |
test/README.md
Outdated
@@ -410,6 +410,10 @@ The realpath of the 'tmp' directory. | |||
|
|||
Name of the temp directory used by tests. | |||
|
|||
### childShouldNotThrowAndAbort() | |||
This test makes sure that when using `--abort-on-uncaught-exception` and when throwing an error |
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.
There's an unnecessary indent on these two lines
|
||
d.once('error', (err) => { | ||
errorHandlerCalled = true; | ||
}); |
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.
The errorHandlerCalled
can be replaced by using common.mustCall()
...e.g.
d.once('error', common.mustCall(() => {}));
New changes submitted |
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.
@jasnell’s comment on test/README.md
should still be addressed, but otherwise LGTM. Thank you!
@cjihrig ... PTAL when you get a moment |
test/README.md
Outdated
@@ -412,6 +412,9 @@ The realpath of the 'tmp' directory. | |||
|
|||
Name of the temp directory used by tests. | |||
|
|||
### childShouldNotThrowAndAbort() | |||
This test makes sure that when using `--abort-on-uncaught-exception` and when throwing an error from within a domain that has an error handler setup, the process _does not_ abort. |
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.
Please add a newline here, and wrap the line at 80 characters.
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.
@cjihrig Sorry what do you mean by naming the temp directory used by tests? I am a little confused 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.
I meant a blank line between ### childShouldNotThrowAndAbort()
and the following paragraph. Also, lines should be 80 characters long. I'm not sure what you mean by temp directory.
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.
Sorry I misread your comment, I thought Name of the temp directory used by tests.
was part of your comment.
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.
I submitted the changes as suggested
@clarenced Any chance you can rebase this to eliminate the conflicts? (The biggest issue you are likely to run into is that the stuff you put in test/README.md and test/common.js now goes in test/common/README.md and test/common/index.js.) If that happens, I'll give it another review and try to loop in @cjihrig to get this unstuck. |
@clarenced just let me know when/if you rebase this. Happy to take another look. Dismissing my review for now
This seems to be stalled. I'm going to close it. By all means, if you're still working on this, please comment to that effect. Thanks! |
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test, domain