Uh oh!
There was an error while loading. Please reload this page.
common.mustCall() is added - #34920
Conversation
Please enter the commit message for your changes. Lines starting
nodejs-github-bot
commented
Aug 30, 2020
| // Server | ||
| const server = net.createServer(function(conn) { | ||
| const server = net.createServer(common.mustCall(function(conn) { |
There was a problem hiding this comment.
This gives a false sense of security. This is a child process and if the child process fails, it doesn't affect the test. You can see this if you add a 2 as the second argument to common.mustCall() so that it causes an assertion. It will print the assertion message, but the test still passes.
$ ./node test/sequential/test-net-response-size.jsServer running.server received 65536 bytesserver received 36864 bytesserver received 1 bytesMismatched <anonymous> function calls. Expected exactly 2, actual 1. at Proxy.mustCall (/Users/trott/io.js/test/common/index.js:329:10) at Object.<anonymous> (/Users/trott/io.js/test/sequential/test-net-response-size.js:35:42) at Module._compile (internal/modules/cjs/loader.js:1090:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1111:10) at Module.load (internal/modules/cjs/loader.js:955:32) at Function.Module._load (internal/modules/cjs/loader.js:796:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47
$ tools/test.py test/sequential/test-net-response-size.js[00:01|% 100|+ 1|- 0]: Done
$ There was a problem hiding this comment.
I understand that this is not so useful because common.mustcall() is enclosed in child process. Thanks for the replay and I will close the PR.
| })); | ||
| server.listen(common.PORT, '127.0.0.1', function() { | ||
| server.listen(common.PORT, '127.0.0.1', common.mustCall(function() { |
There was a problem hiding this comment.
Same problem as above.
$ ./node test/sequential/test-net-response-size.js Server running.server received 65536 bytesserver received 36864 bytesserver received 1 bytesMismatched <anonymous> function calls. Expected exactly 2, actual 1. at Proxy.mustCall (/Users/trott/io.js/test/common/index.js:329:10) at Object.<anonymous> (/Users/trott/io.js/test/sequential/test-net-response-size.js:45:50) at Module._compile (internal/modules/cjs/loader.js:1090:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1111:10) at Module.load (internal/modules/cjs/loader.js:955:32) at Function.Module._load (internal/modules/cjs/loader.js:796:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47
$ tools/test.py test/sequential/test-net-response-size.js[00:01|% 100|+ 1|- 0]: Done
$There was a problem hiding this comment.
Welcome, @PoojaDurgad, and thanks for the pull request! I appreciate the effort, but I don't think we should do this for the reasons described in the comments.
PoojaDurgad
commented
Aug 31, 2020
Thanks,@Trott ,for reviewing my pull request and I understand that this is not so useful. |
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes