-
Notifications
You must be signed in to change notification settings - Fork 30k
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: missing expected exception in parallel/test-require-deps-deprecation.js #17148
Comments
@Tiriel What's the output if you run this?: ./node test/parallel/test-require-deps-deprecation.js |
@Tiriel Also, what's the output of each of these two commands?: ./node -e "require('acorn/dist/acorn')" ./node -e "require('acorn/dist/walk')" |
Hey @Trott , Thanks!
$ ./node test/parallel/test-require-deps-deprecation.js
assert.js:42
throw new errors.AssertionError({
^
AssertionError [ERR_ASSERTION]: Missing expected exception.
at innerThrows (assert.js:186:7)
at Function.throws (assert.js:205:3)
at Object.<anonymous> (/home/benjamin/Dev/javascript/NodeFoundation/node/test/parallel/test-require-deps-deprecation.js:43:10)
at Module._compile (module.js:644:30)
at Object.Module._extensions..js (module.js:655:10)
at Module.load (module.js:563:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:685:10)
at startup (bootstrap_node.js:192:16)
module.js:547
throw err;
^
Error: Cannot find module 'acorn/dist/foo'
at Function.Module._resolveFilename (module.js:545:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:588:17)
at require (internal/module.js:11:18)
at [eval]:1:1
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at Object.runInThisContext (vm.js:152:38)
at Object.<anonymous> ([eval]-wrapper:6:22)
at Module._compile (module.js:644:30)
at evalScript (bootstrap_node.js:471:27) |
|
Damn, you got it. Sorry I missed this. Thanks! |
@Tiriel It's conceivable that a sensible solution is to PR in a change to |
@Trott But it would then need to be re set afterwards right? I'm not really good at sysadmin, but can it be unset temporarily? |
You can unset it for the subprocess only. It won't affect the invoking shell. $ NODE_PATH='foo' ./node -e 'console.log(process.env.NODE_PATH)'
foo
$ echo $NODE_PATH
$ |
@Trott Awesome, thanks! And sorry for being such a weight ^^' |
I'll just reopen this since it seems there may be a solution and a fix that would solve the problem for people potentially having it like me. Right now I'm investigatin the problem, but prefixing the commands in the Makefile hasn't improved the situation yet. I think because the Python is launching the tests by executing commands, and so the temporary assignment is lost. 4ill try and dig inside If anyone as another idea, they're deeply welcome to share! |
@Tiriel There's already code in
Perhaps the root cause of the problem is something else. Maybe check for the other things listed in https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders that confound module loading:
(I think |
You can also set |
Awesome thanks both of you! I'll check into it ASAP |
Okay, this was a long time ago, but I finally had the time to put some more tests to it. Simply checked But I must admit I'm note sure which path to follow from now on. I'm searching for a way to limit the upward iterating to a certain number of levels, at least locally in this test file, but it seems weird. Any intake, or should I just drop it and ignore this test failing when building Node? |
@Tiriel I propose this: Change the I'm happy to put that together as a PR, but would be even happier to see you do it. Let me know. :-D |
@Trott awesome thanks ! I’ll open a PR later today ! |
Test test-require-deps-deprecation.js was failing when user already had node installed with acorn in require.resolve range. Modified test to acknowledge the possibility and throw only if acorn is found in the deps directory. Fixes: nodejs#17148 Refs: nodejs#17148 (comment)
Fix following review. Reinstated assertion on error message, and corrected comment. Leaving continu to break loop and avoid unneeded assertions. Fixes: nodejs#17148 Refs: nodejs#17148 (comment)
Test test-require-deps-deprecation.js was failing when user already had node installed with acorn in require.resolve range. Modified test to acknowledge the possibility and throw only if acorn is found in the deps directory. Also changed the deprecation test for v9.x: common.expectWarning was failing because the required deps now throw ReferenceErrors when not properly called internally in the right order. PR-URL: nodejs#17848 Fixes: nodejs#17148 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Test test-require-deps-deprecation.js was failing when user already had node installed with acorn in require.resolve range. Modified test to acknowledge the possibility and throw only if acorn is found in the deps directory. Also changed the deprecation test for v9.x: common.expectWarning was failing because the required deps now throw ReferenceErrors when not properly called internally in the right order. Bacport-PR-URL: #18077 PR-URL: #17848 Fixes: #17148 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Hey there!
Got this error when running tests on master:
If I'm corect this was added some three days ago in this commit 7ce6d23 but I have no idea why that doesn't throws, when the patch was specifically designed to make this kind of
require
throw.Is it only me?
For the record, I thought I had done some breaking changes without wanting it, so I erase my copy and re cloned it, fetched the last updates and then ran
./configure
andmake
. Build is as fresh as it can get.The text was updated successfully, but these errors were encountered: