-
Notifications
You must be signed in to change notification settings - Fork 326
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
chore(nns): reduce logging in tests #1367
Conversation
826ead0
to
a4e3a60
Compare
rs/nervous_system/neurons_fund/src/polynomial_matching_function_tests.rs
Show resolved
Hide resolved
a4e3a60
to
c9f4a99
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.
NCR
In general, I do not like dropping data. Ofc, I also hate log spam. These concerns are somewhat in conflict, but I think we can usually satisfy both. The key is to be selective. Throwing out the bath water good. Throwing out the baby bad.
I wouldn't say all the deleted logging are super high value, but they aren't spam either.
I don't think the title matches. More precisely, some of the deleted logging is NOT only during tests. I like what the title claims more than what the code changes actually do.
Ideally (i.e. maybe not in this PR), we would have a generalized ability to filter out logs (and apply that to tests), rather than deleting logging entirely. At Google, there is this nice flag called --vmodule, which is kind of what I'm thinking of. You could use that to turn on "super debug" level logs by filename. Maybe what we want here is the opposite: be able to turn OFF some logs.
Maybe, we could do that like this:
#[cfg(???)]
use filter_out_some_logs_in_tests::println;
I agree that some of these are useful and they're not just being disabled in tests. But fast tests > logs IMO. I wonder if it would be possible to buffer them to get the best of both worlds. |
If it was just a case of fast tests or good production logs, it would be a bit more nuanced. These logs were not printing in production, and some were only meant for tests in the first place, and they all created so much noise in tests that it broke our local test runners. We all agree logs are good. |
There are many logs that are helpful in mainnet that are creating too much noise in tests, causing in some cases the testing infrastructure to get overwhelmed and hang during cleanup.
Additionally, removing the extra logs reduces the test run time from ~40s to ~5s.