-
Notifications
You must be signed in to change notification settings - Fork 181
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
Remove double exception print #4246
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4246 +/- ##
==========================================
+ Coverage 77.11% 77.18% +0.07%
==========================================
Files 761 761
Lines 41473 41472 -1
Branches 8763 8763
==========================================
+ Hits 31981 32010 +29
+ Misses 8437 8406 -31
- Partials 1055 1056 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This pull request contains changes requested by Matyáš. First, I extracted the changes from #4191 that didn’t belong to that PR. Then, I only kept the requested changes, replacing an intermediary PR #4237. Both pull requests introduce changes to the now untested test connection mechanic and both deal with exception handling. Because of that, general unit tests for sub-method calls are included in both of them. After one PR will have been merged I will resolve the conflict in the other one. As for the caplog fixture, that is not supported on Python ≤2.7, I’m aware that the suggestion was to mark the tests as skipped. The change to logger asserts was however trivial. Moreover, I already used those in the sister pull request #4211. Such asserts are less semantic, but working. They need to be replaced after fixing the pipeline, but so do the skip marks. Opening the pull request for review. @m-horky |
b7596a8
to
42f4da9
Compare
42f4da9
to
b9e76ea
Compare
If #4211 gets merged first, this pull request would bring a regression. The other PR extends the set of exceptions caught by the outer test_connection method, but this one removes the redundant exception print from the same method. That means that after merging #4211, exceptions will be properly printed for read timeouts too (currently they are not), but then after merging this PR, that print will get removed. As a result, the read timeouts will be caught and would not dump a traceback, but wouldn’t have a nice print. To fix that, exception handling in the inner _(legacy_)test_urls methods needs to be extended too. Doing so, read timeouts would reach the proper inner print and the outer one won’t be necessary – which was the original intention of this PR. I will create a new pull request to unblock this one. |
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.
ACK. One note.
b9e76ea
to
737548e
Compare
737548e
to
aab265d
Compare
There is also #4254 in the family. It neither blocks anything nor is blocked by anything. It only shares some tests. |
#4248 got merged. There are now conflicts. That’s because both PRs contained same tests. Will resolve and re-request a review. |
084d80b
to
c158611
Compare
Rebased on the current master with #4248 merged. Resolved conflicts in the tests:
This pull request only changes what is print on standard output. It is a part of what’s communicated to the user though. Because of that there are error log tests too. Prints and logging are always happen at the same time. They are on adjacent lines. |
In case of a connection error, an exception description was printed on the standard output twice: once by the outer test_connection method and once by the inner _(legacy_)test_urls method. The legacy version tries multiple URLs and prints the exception description on each failure. Thus, removed the outer print that only duplicates the last caught exception. Card IDs: * CCT-724 Signed-off-by: Štěpán Tomsa <[email protected]>
c158611
to
5e34f37
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.
ACK. Hi @xiangce, good to merge!
In case of a connection error, an exception description was printed on the standard output twice: once by the outer test_connection method and once by the inner _(legacy_)test_urls method. The legacy version tries multiple URLs and prints the exception description on each failure. Thus, removed the outer print that only duplicates the last caught exception. Card IDs: CCT-724 Signed-off-by: Štěpán Tomsa <[email protected]> (cherry picked from commit 11209f9)
All Pull Requests:
Check all that apply:
Complete Description of Additions/Changes:
In case of a connection error, an exception description was printed on the standard output twice: once by the outer test_connection method and once by the inner _(legacy_)test_urls method. The legacy version tries multiple URLs and prints the exception description on each failure. Thus, removed the outer print that only duplicates the last caught exception.
Card IDs: