-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Suppress noisy output from qa tests in Travis #9780
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
Conversation
qa/pull-tester/rpc-tests.py
Outdated
|
|
||
| # Set up logging handler | ||
| sh = logging.StreamHandler() | ||
| sh.setLevel((logging.INFO if args.quiet else logging.DEBUG)) |
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.
Maybe only call sh.setLevel if args.quiet is true, because logging.DEBUG can still throw away logs at levels < 10.
| try: | ||
| print("From" , f, ":") | ||
| print("".join(deque(open(f), MAX_LINES_TO_PRINT))) | ||
| except: |
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 this very broad exception handler could hide information we might like to know about. I would remove it, or narrow it, or at least at stick a "traceback.print_exc()" call in here.
If this handler is supposed to handle the case where f does not exist, you could add an "if os.path.exists(f)" or similar check above.
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.
Printing the tails of the log files here is simply to help if the test case fails on travis. My thinking in adding the try/except handling is that if reading a log file fails for any reason, we should just continue and try to print out the other log files. I don't want there to be any chance that this commit makes the logging available on travis any worse.
I've added a print out of the stack trace exception in the except branch. Does that allay your concerns here?
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.
The print addresses most of my concern. If something goes wrong, I would prefer to know about it.
I also think you should change the bare except to except OSError or except Exception. It isn't right to ignore exceptions like SystemExit or KeyboardInterrupt and keep looping if someone is trying to kill the program. (For reference: https://docs.python.org/3/library/exceptions.html#exception-hierarchy)
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.
Agree on catching only a more concrete exception, specially if you're expecting one in particular, as it seems to be the case in a2a5651 . Also you could print the message of the exception too (before the traceback).
|
Concept ACK, filtering signal/noise has been a pet peeve of me for as long as we have a travis run, but never got around to it. Thanks for doing this. |
|
I like the approach, but I think that it would be preferable to have some output (e.g., periods) while the tests are running. This is because of a limitation in Travis CI where if no output is seen for 10 minutes the build will fail. This has been a problem historically in the unit tests, but was only addressed (by me) by making them run more quickly such that this is not an issue. |
|
Yes, printing periods or another kind of progress display would be nice. My issue is with tons of unnecessary debug output. Edit: But don't we already do that during the RPC tests, printing periods? |
|
utACK d580707 |
|
@laanwj - this PR suppresses the period printing when running --quiet mode. Do you want me to put that back in? |
Not necessarily. Just in the mode that Travis uses, apparently it needs to print something (and dots are better than text spam :-) to avoid the timeout problem that @JeremyRubin mentions. |
d580707 to
85312c0
Compare
|
I've rebased this now that #9657 has been merged. I've also made a change so that period printing still happens in quiet mode. That should prevent any Travis timeout issues. |
|
re-utACK 85312c075e7bf3379e0a277e3393e734f940b71c. Confirmed no changes since last rebase other than restoring the print('.'). I would definitely prefer not to be adding the catch-all except handler here, though: #9780 (comment) |
|
rebased and addressed #9780 (comment). |
|
utACK a2a565180449b80c054c05c12c93097f1e8752c2 except for @ryanofsky 's nit. Needs rebase. |
|
Updated the exception handler to catch only OSError exceptions as suggested by @ryanofsky and rebased. |
|
Needs rebase again. |
rpt-tests.py outputs progress information as it runs tests. This commit adds a --quiet option that suppresses that progress output and only prints a summary of results (and logs from failed tests).
|
rebased. I think this is useful PR since it suppresses noisy output in travis when tests pass and also increases the amount of logging available when the test fails. This will be helpful in debugging intermittent functional test failures in Travis. @MarcoFalke , @laanwj - can I convince you to review this PR? |
|
utACK 2c0be25 |
|
utACK 2c0be25bd6b744cab60a3672409750545522733a. Please squash the fixup commit. |
|
squashed |
8c7288c Print out the final 1000 lines of test_framework.log if test fails (John Newbery) 6d780b1 Update travis config to run rpc-tests.py in quiet mode (John Newbery) 55992f1 Add --quiet option to suppress rpc-tests.py output (John Newbery) Tree-SHA512: ab080458a07a9346d3b3cbc8ab59b73cea3d4010b1cb0206bb5fade0aaac7562c623475d0a02993f001b22ae9d1ba68e2d0d1a3645cea7e79cc1045b42e2ce3a
8c7288c Print out the final 1000 lines of test_framework.log if test fails (John Newbery) 6d780b1 Update travis config to run rpc-tests.py in quiet mode (John Newbery) 55992f1 Add --quiet option to suppress rpc-tests.py output (John Newbery) Tree-SHA512: ab080458a07a9346d3b3cbc8ab59b73cea3d4010b1cb0206bb5fade0aaac7562c623475d0a02993f001b22ae9d1ba68e2d0d1a3645cea7e79cc1045b42e2ce3a
8c7288c Print out the final 1000 lines of test_framework.log if test fails (John Newbery) 6d780b1 Update travis config to run rpc-tests.py in quiet mode (John Newbery) 55992f1 Add --quiet option to suppress rpc-tests.py output (John Newbery) Tree-SHA512: ab080458a07a9346d3b3cbc8ab59b73cea3d4010b1cb0206bb5fade0aaac7562c623475d0a02993f001b22ae9d1ba68e2d0d1a3645cea7e79cc1045b42e2ce3a
The QA tests are currently quite noisy even when they run successfully. They output progress information which fills up pages of screen. This might be what you want when running the tests locally, but for build/integration tools it fills the output log with spam.
This PR suppresses noisy output from the qa tests. It builds on and requires both #9657 and #9768. There are three commits specifically for this PR:
Example of a successful travis run: https://travis-ci.org/jnewbery/bitcoin/jobs/202373787
Example of a failed travis run: https://travis-ci.org/jnewbery/bitcoin/jobs/202374810