Repository navigation
Conversation
joshuarli
added a commit
that referenced
this pull request
Feb 14, 2026
seen in this run of shuffle-tests: https://github.com/getsentry/sentry/actions/runs/21654747518/job/62427093320 i'm working on some tools to use detect-test-pollution to automatically bisect test sets from shuffle-test runs here: #108281 https://github.com/getsentry/sentry/actions/runs/22007196153/job/63593472299 that identified that running these two tests in this order: ``` pytest tests/sentry/integrations/github/test_installation.py::InstallationEndpointTest::test_installation_endpoint tests/sentry/utils/test_sdk.py::CheckScopeTransactionTest::test_custom_transaction_name ``` fails consistently without this fix --- - `test_custom_transaction_name` was mocking the wrong scope — it used `patch_isolation_scope()` (which patches `Scope.get_isolation_scope()`), but `check_current_scope_transaction()` reads from `sentry_sdk.get_current_scope()`. The test passed in isolation only because the current scope had `_transaction=None`, short-circuiting the check without ever validating the `source="custom"` logic. - When preceded by a test like `test_installation_endpoint` that sets a real transaction on the current scope, the leaked state caused the assertion to fail. - Fixed by mocking `sentry_sdk.get_current_scope` instead, consistent with the other two tests in the same class.
Member
Author
|
closing; will be combining with #108286 |
This branch was successfully deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
this adds a workflow_dispatch that when given a shuffle tests run url:
detect-test-pollutionwhich automatically bisects down to the polluting teststhis is really useful for parallelizing the bisection of these polluting tests since the alternative would be to have these things going in separate sentry devenvironment VMs which do not exist at the moment