test: Fix flaky test-vm-timeout-rethrow#11530
test: Fix flaky test-vm-timeout-rethrow#11530kunalspathak wants to merge 3 commits intonodejs:masterfrom
Conversation
The intention of test case is to make sure that `timeout` property is honored and the code in context terminates and throws correct exception. However in test case, the code inside context would complete before `timeout` for windows and would sometimes fail. Updated the code so it guarantee to not complete execution until timeout is triggered. Fixes: nodejs#11261
| 'while(true);\n' + | ||
| 'j;'; | ||
|
|
||
| const ctx = vm.createContext({ |
There was a problem hiding this comment.
Can you drop theadd() function here as well?
joshgav
left a comment
There was a problem hiding this comment.
LGTM with a nit. Thanks Kunal!
| @@ -6,14 +6,10 @@ const spawn = require('child_process').spawn; | |||
|
|
|||
| if (process.argv[2] === 'child') { | |||
| const code = 'let j = 0;\n' + | |||
There was a problem hiding this comment.
Can you reduce the whole block to while(true); while you're at it? I.e. no need for declaring j either.
There was a problem hiding this comment.
I left it intentionally so it can be used in return, but with while(true); won't be necessary. Will remove it.
|
Landed in c3bc48f. Thanks! |
The intention of test case is to make sure that `timeout` property is honored and the code in context terminates and throws correct exception. However in test case, the code inside context would complete before `timeout` for windows and would sometimes fail. Updated the code so it guarantee to not complete execution until timeout is triggered. Fixes: #11261 PR-URL: #11530 Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
The intention of test case is to make sure that `timeout` property is honored and the code in context terminates and throws correct exception. However in test case, the code inside context would complete before `timeout` for windows and would sometimes fail. Updated the code so it guarantee to not complete execution until timeout is triggered. Fixes: nodejs#11261 PR-URL: nodejs#11530 Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
The intention of test case is to make sure that `timeout` property is honored and the code in context terminates and throws correct exception. However in test case, the code inside context would complete before `timeout` for windows and would sometimes fail. Updated the code so it guarantee to not complete execution until timeout is triggered. Fixes: #11261 PR-URL: #11530 Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
The intention of test case is to make sure that `timeout` property is honored and the code in context terminates and throws correct exception. However in test case, the code inside context would complete before `timeout` for windows and would sometimes fail. Updated the code so it guarantee to not complete execution until timeout is triggered. Fixes: #11261 PR-URL: #11530 Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
The intention of test case is to make sure that `timeout` property is honored and the code in context terminates and throws correct exception. However in test case, the code inside context would complete before `timeout` for windows and would sometimes fail. Updated the code so it guarantee to not complete execution until timeout is triggered. Fixes: #11261 PR-URL: #11530 Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
The intention of test case is to make sure that `timeout` property is honored and the code in context terminates and throws correct exception. However in test case, the code inside context would complete before `timeout` for windows and would sometimes fail. Updated the code so it guarantee to not complete execution until timeout is triggered. Fixes: #11261 PR-URL: #11530 Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
|
@kunalspathak FWIW: Got my testing stuck today on this test on Windows 7 x64. Process explorer showed |
The intention of test case is to make sure that
timeoutproperty is honoredand the code in context terminates and throws correct exception. However in
test case, the code inside context would complete before
timeoutfor windowsand would sometimes fail. Updated the code so it guarantee to not complete
execution until timeout is triggered.
Fixes: #11261
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)