-
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: allow specifying more known globals via ENV #15187
test: allow specifying more known globals via ENV #15187
Conversation
8c172a9
to
d496037
Compare
test/common/index.js
Outdated
@@ -355,7 +355,7 @@ let knownGlobals = [ | |||
process, | |||
setImmediate, | |||
setInterval, | |||
setTimeout | |||
setTimeout, |
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.
btw, this change is somewhat unrelated ;)
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.
Yes, I thought for a second I could add it here, but it's not the right place.
Reverted the comma.
d496037
to
6baa612
Compare
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 don't think we should make it a habit of adding miscellaneous globals from IDEs.
I don't understand the need for this for running the test suite. To me, this seems like something JetBrains should fix, not us. |
I added a reference to the Issue I opened for JetBrains, meanwhile it's a nuisance for devs who want to debug the tests with a JetBrains tool. |
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.
Making it explicit
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 think it is a reasonable exception in order to make a dev's life easier and we shouldn't be purist about it -it's helpful and there is no harm.
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.
Given how unlikely it is to have a legitimate _jb_debug_helper
global leaking from our code, I'd say LGTM.
I'm with Brian and Colin: if your tool of choice is broken, fix it or use a better one, don't add hacks. |
I don't think we can guarantee inspectors won't inject things. Perhaps we could have a way to force code tampering off? |
@Fishrock123 If you do that, then you won't know when non-IDE globals start leaking... |
It is my understanding that the global leak checks do not use the inspector, (or at the very least they pre-date the inspector)? |
Another possible alternative solution to just saying no would be to introduce an environment variable that |
I won't strenuously object but that's still adding complexity to work around a broken tool. |
What is the conclusion here? We have a couple of persons pro and a couple of persons against it. I personally have no strong opinion about this but I am somewhat with @cjihrig etc that this should be fixed in JetBrains and not in Node. |
Even though I'm in favor of this PR, I think it should be closed given the number of 👎's this is getting. My two cents. |
Yeah, if I'm not mistaken, there's only two ways this could land:
|
IMHO It's not worth escalating. |
Still LGTM, but now Node.js is not aware of hard coded debugger values - so that's nice. |
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.
This seems more reasonable to me.
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.
This is much cleaner 👍
@mscdex are you still against this with the current change? |
It still shouldn't be necessary though... |
17e2716
to
21cb0ef
Compare
PR-URL: nodejs#15187 Refs: https://youtrack.jetbrains.com/issue/WEB-27528 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
21cb0ef
to
b8d532c
Compare
PR-URL: nodejs/node#15187 Refs: https://youtrack.jetbrains.com/issue/WEB-27528 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #15187 Refs: https://youtrack.jetbrains.com/issue/WEB-27528 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: nodejs/node#15187 Refs: https://youtrack.jetbrains.com/issue/WEB-27528 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #15187 Refs: https://youtrack.jetbrains.com/issue/WEB-27528 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #15187 Refs: https://youtrack.jetbrains.com/issue/WEB-27528 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
update
In order to provide a smoother test dev experience, with less false positives, we should allow specifying more known global symbols. This implementation uses an ENV var for said specification.
Example
end update
When debugging
/test/
using JetBrains' debugger sometimes it leaked a global symbol_jb_debug_helper
:A bug report was opened upstream for said IDE
Refs: https://youtrack.jetbrains.com/issue/WEB-27528
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test