Remove forked from test_transport, separate gevent tests and generalize capturing_server to be module level#4577
Merged
sl0thentr0py merged 1 commit intomasterfrom Jul 17, 2025
Merged
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
sl0thentr0py
commented
Jul 15, 2025
Member
Author
There was a problem hiding this comment.
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
Member
Author
|
as a side, I also really tried to make the gevent test not forked, but the shutdown in |
sl0thentr0py
added a commit
that referenced
this pull request
Jul 17, 2025
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`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CapturingServertoconftestfor reusecapturing_serverin original non-forked transport tests to be module level for faster testsgeventbased transport tests to separate file since they still need to be forked because of the global monkeypatchAs a result,
test_transportnow takes 13 seconds instead of almost 3 minutes.BEFORE
AFTER
part of #4538