-
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: replace console.error() with debuglog calls #32588
Conversation
Replace magic numbers with constant. Use for loop for repeated code. Reduce console logging. Remove unneeded countdown module use. PR-URL: #32547 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@Trott, there are a 100 places where |
I'd prefer not until we have a clear/obvious/documented way to cause those debug statements to show up in CI (Jenkins and GitHub Actions). We'd also have to be careful not to do this in tests where I'm doing this one because I felt bad because I somehow messed it up when I just landed a change to the test a day ago. Other people (notably @jasnell) might be considerably more enthusiastic about it than I am, though. |
Incrementally where it makes sense, yes. The idea is to separate output that is considered part of the test itself from informational/debug output. The rationale is to make the intent of the output clear and to avoid cases where the debug output itself may alter the outcome of the test (this is extremely rare but we have encountered it before so the probability is definitely non-zero). What I would not do is make these changes all at once. If someone is updating a test file for another reason, then it makes sense to also make these changes. Or, if we want to document which ones can be changed, it would make a good first contribution for a new contributor to change one test at a time.
@nodejs/build can enable that by optionally adding |
Counterpoints:
Yeah, true, that works when you can make the test fail reliably in the local environment. However, that is not the case I am concerned about. I am concerned about relatively infrequent failures ("flaky" tests) that happen on platforms that maybe the person debugging doesn't have easy access to. (This is a situation I have found myself in more often than I like, and I know I'm not the only one.)
I would, but I don't expect everyone to agree with me on that, so it's 👍 that you don't. In any event, it's definitely a solvable problem. Someone just needs to spend a little time doing it. (On my list!) |
you could enable it via the |
@Trott Technically, this is ready to land … if you think we should, feel free to go ahead. (As you know, I don’t personally have a strong opinion here.) |
@rvagg I hadn't considered that viable because if we do it that way, it will be on all the time in CI rather than only when requested. Considering it more now, I suppose that could be considered desirable, although it could also be a reason to not do these kinds of changes at all. |
Well, I'm not super keen on more verbose logs having to be stored by Jenkins and parsed by users, they're pretty big as they are. I'm just saying this is an option if it's needed, I don't consider myself in a position to judge whether it is or not! |
Somehow thought I did this in 8905be2 but clearly did not. PR-URL: nodejs#32588 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
41c5144
to
83ebd77
Compare
Landed in 83ebd77 |
Somehow thought I did this in 8905be2
but clearly did not.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes