-
Notifications
You must be signed in to change notification settings - Fork 554
Remove forked from test_transport, separate gevent tests and generalize capturing_server to be module level #4577
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
6dddfe7
to
b4977f6
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #4577 +/- ##
==========================================
+ Coverage 80.71% 80.72% +0.01%
==========================================
Files 156 156
Lines 16507 16507
Branches 2806 2806
==========================================
+ Hits 13323 13325 +2
+ Misses 2300 2295 -5
- Partials 884 887 +3 |
5e916da
to
65f431b
Compare
65f431b
to
9876504
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.
ultimately, I want to isolate all gevent tests here so they don't leak into the rest of the codebase
9876504
to
5c1da2f
Compare
5c1da2f
to
6d65e0d
Compare
as a side, I also really tried to make the gevent test not forked, but the shutdown in |
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 changes in #4577 introduced a bit of flakiness on pre-3.10 due to a weird interaction of `capsys`, `stderr` logging and our object lifecycles. In this PR, I'm removing all the explicit `__del__` `kill`s since we [call them all explicitly in `client.close`](https://github.com/getsentry/sentry-python/blob/09c2e32cc7a618e49f5d8ae59e22d8b12f253687/sentry_sdk/client.py#L1001-L1021) anyway and that's already cleaner. Having logic in `__del__` causes non-deterministic GC behavior, especially with threaded code. Stacktrace is linked in a comment below where you can see the `transport.__del__` method is causing the weird `reentrant` logging bug to `stderr`.
CapturingServer
toconftest
for reusecapturing_server
in original non-forked transport tests to be module level for faster testsgevent
based transport tests to separate file since they still need to be forked because of the global monkeypatchAs a result,
test_transport
now takes 13 seconds instead of almost 3 minutes.BEFORE
AFTER
part of #4538