René's URL Explorer Experiment


Title: Flaky Django cache span tests in streaming mode · Issue #8027 · getsentry/sentry-python · GitHub

Open Graph Title: Flaky Django cache span tests in streaming mode · Issue #8027 · getsentry/sentry-python

X Title: Flaky Django cache span tests in streaming mode · Issue #8027 · getsentry/sentry-python

Description: tests/integrations/django/test_cache_module.py::test_cache_spans_item_size[True] and ::test_cache_spans_decorator[True] fail intermittently on master in streaming mode (span_streaming=True). Both tests make two requests, one trace each, ...

Open Graph Description: tests/integrations/django/test_cache_module.py::test_cache_spans_item_size[True] and ::test_cache_spans_decorator[True] fail intermittently on master in streaming mode (span_streaming=True). Both t...

X Description: tests/integrations/django/test_cache_module.py::test_cache_spans_item_size[True] and ::test_cache_spans_decorator[True] fail intermittently on master in streaming mode (span_streaming=True). Both t...

Opengraph URL: https://github.com/getsentry/sentry-python/issues/8027

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Flaky Django cache span tests in streaming mode","articleBody":"`tests/integrations/django/test_cache_module.py::test_cache_spans_item_size[True]` and `::test_cache_spans_decorator[True]` fail intermittently on master in streaming mode (`span_streaming=True`). Both tests make two requests, one trace each, and index the captured spans by position. Sometimes request 2's spans arrive first.\n\n**Failure**\n```\ntests/integrations/django/test_cache_module.py:763: in test_cache_spans_item_size\n    assert not spans[0][\"attributes\"][\"cache.hit\"]\nE   assert not True\n```\n`test_cache_spans_decorator[True]` fails the same way at line 384.\n\n**Expected vs actual**\n- Expected: `spans[0]` is request 1's `cache.get`, a miss.\n- Actual: `spans[0]` is request 2's `cache.get`, a hit. `len(spans) == 7` still passes; only the order across the two traces changes.\n\n**CI failures on master (Sep 30 – Oct 13, 6 of 33 `Test` runs)**\n- `test_cache_spans_item_size[True]`: py3.14 django-v6.1.2, `916942d` ([job](https://github.com/getsentry/sentry-python/actions/runs/38401183446/job/115308926910)); py3.14 django-v6.1.1, `b5737a0` ([job](https://github.com/getsentry/sentry-python/actions/runs/37482438288/job/112333779485)); py3.14 django-v6.1.1, `8afefe8` ([job](https://github.com/getsentry/sentry-python/actions/runs/36872457774/job/110403408859))\n- `test_cache_spans_decorator[True]`: py3.12 django-v4.2.30, `6a4eb20` ([job](https://github.com/getsentry/sentry-python/actions/runs/37353417938/job/111909675607)); py3.14 django-v5.2.17, `bf1e2f9` ([job](https://github.com/getsentry/sentry-python/actions/runs/36718657588/job/109897836977)); py3.10 django-v5.2.17, `8012047` ([job](https://github.com/getsentry/sentry-python/actions/runs/36712378716/job/109877001736))\n- Always the `Web 1` job, always `[True]` (streaming). It appears on Django 4.2 through 6.1 and Python 3.10 through 3.14.\n\n**Known trigger**\n- In streaming mode, each finished segment adds its `trace_id` to `SpanBatcher._pending_flush`, which is a `set` (`sentry_sdk/_span_batcher.py`). Pending flushing was added in #7170.\n- If the background flusher wakes only after both requests' segments have finished, `list(self._pending_flush)` sends the two traces in set (hash) order instead of the order they finished. That happens about 50% of the time once both are pending.\n- On an idle machine the flusher usually sends request 1 before request 2 ends. A busy CI runner delays the flusher thread, so both end up pending.\n- #7444 (uuid `LOCATION` for the cache) fixed a different flake in these tests. These failures all happened after it was merged.\n\n\u003c!-- junior-request-attribution:start -->\nvia **johdax**.\n\u003c!-- junior-request-attribution:end -->\n\n\u003c!-- junior-session-footer:start -->\n\u003c!-- junior-conversation-id:agent-dispatch%3Adispatch_6df7374375b237816e130534b6439833 -->\n\n--\n\n[View Junior Session](https://junior-prod.sentry.dev/conversations/agent-dispatch%3Adispatch_6df7374375b237816e130534b6439833) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent-dispatch%3Adispatch_6df7374375b237816e130534b6439833/?project=4510944073809921)\n\n\u003c!-- junior-session-footer:end -->","author":{"url":"https://github.com/apps/sentry-junior","@type":"Person","name":"sentry-junior"},"datePublished":"2026-10-14T09:22:40Z","url":"https://github.com/getsentry/sentry-python/issues/8027"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8f10b35b-f879-330f-bc44-b851416b25bb
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD860:7A60E:CB1617:107231F:6B00F2DD
html-safe-noncea677701d8a626e34fa55bb0d6f4d1e300403fc4382c7f63b5fb920ccff1f3466
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODYwOjdBNjBFOkNCMTYxNzoxMDcyMzFGOjZCMDBGMkREIiwidmlzaXRvcl9pZCI6IjQwOTgwMzM2NDEyOTUyNDYwNDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca2d555b9d3191d09d6f086c2f702a4393690546688b4eb559af7907ecceb063e
hovercard-subject-tagissue:5845247890
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/8027/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b318e95171717e1f5c60e361781cb292bd005d1bf46302354eb33428890e53d5/getsentry/sentry-python/issues/8027
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b318e95171717e1f5c60e361781cb292bd005d1bf46302354eb33428890e53d5/getsentry/sentry-python/issues/8027
og:image:alttests/integrations/django/test_cache_module.py::test_cache_spans_item_size[True] and ::test_cache_spans_decorator[True] fail intermittently on master in streaming mode (span_streaming=True). Both t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesentry-junior[bot]
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id137814779
octolytics-dimension-repository_nwogetsentry/sentry-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id137814779
octolytics-dimension-repository_network_root_nwogetsentry/sentry-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-python/issues/8027#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F8027
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F8027
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-python
Reloadhttps://github.com/getsentry/sentry-python/issues/8027
Reloadhttps://github.com/getsentry/sentry-python/issues/8027
Reloadhttps://github.com/getsentry/sentry-python/issues/8027
getsentryhttps://github.com/getsentry
sentry-pythonhttps://github.com/getsentry/sentry-python
Codehttps://github.com/getsentry/sentry-python
Issues345 (345)https://github.com/getsentry/sentry-python/issues
Pull requests42 (42)https://github.com/getsentry/sentry-python/pulls
Discussionshttps://github.com/getsentry/sentry-python/discussions
Actionshttps://github.com/getsentry/sentry-python/actions
Security and quality2 (2)https://github.com/getsentry/sentry-python/security
Insightshttps://github.com/getsentry/sentry-python/insights
https://github.com/getsentry/sentry-python
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/8027
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/8027
Flaky Django cache span tests in streaming modehttps://github.com/getsentry/sentry-python/issues/8027#top
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
Junior: reproJunior reproduces this bug and drafts a fixhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Junior%3A%20repro%22
PythonSDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Python%22
https://github.com/apps/sentry-junior
sentry-juniorhttps://github.com/apps/sentry-junior
on Oct 14, 2026https://github.com/getsentry/sentry-python/issues/8027#issue-5845247890
jobhttps://github.com/getsentry/sentry-python/actions/runs/38401183446/job/115308926910
jobhttps://github.com/getsentry/sentry-python/actions/runs/37482438288/job/112333779485
jobhttps://github.com/getsentry/sentry-python/actions/runs/36872457774/job/110403408859
jobhttps://github.com/getsentry/sentry-python/actions/runs/37353417938/job/111909675607
jobhttps://github.com/getsentry/sentry-python/actions/runs/36718657588/job/109897836977
jobhttps://github.com/getsentry/sentry-python/actions/runs/36712378716/job/109877001736
ref: Flush trace buckets when segment spans finish #7170https://github.com/getsentry/sentry-python/pull/7170
test(django): Fix flaky cache tests by using uuid for cache LOCATION #7444https://github.com/getsentry/sentry-python/pull/7444
View Junior Sessionhttps://junior-prod.sentry.dev/conversations/agent-dispatch%3Adispatch_6df7374375b237816e130534b6439833
[Sentry]https://sentry.sentry.io/explore/conversations/agent-dispatch%3Adispatch_6df7374375b237816e130534b6439833/?project=4510944073809921
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Oct 14, 2026https://github.com/getsentry/sentry-python/issues/8027#issuecomment-6165129721
Linear Codehttps://linear.app
PY-3001https://linear.app/getsentry/issue/PY-3001
linear-codehttps://github.com/apps/linear-code
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
PythonSDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Python%22
on Oct 14, 2026https://github.com/getsentry/sentry-python/issues/8027#event-33211917830
https://github.com/apps/sentry-junior
sentry-juniorhttps://github.com/apps/sentry-junior
on Oct 14, 2026https://github.com/getsentry/sentry-python/issues/8027#issuecomment-6165141982
getsentry/repro#61https://github.com/getsentry/repro/pull/61
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Oct 15, 2026https://github.com/getsentry/sentry-python/issues/8027#event-33304069049
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 15, 2026https://github.com/getsentry/sentry-python/issues/8027#event-33417522869
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 15, 2026https://github.com/getsentry/sentry-python/issues/8027
sentrivanahttps://github.com/sentrivana
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Oct 15, 2026https://github.com/getsentry/sentry-python/issues/8027#event-33339890859
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 15, 2026https://github.com/getsentry/sentry-python/issues/8027
dingsdaxhttps://github.com/dingsdax
Junior: reproJunior reproduces this bug and drafts a fixhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Junior%3A%20repro%22
on Nov 12, 2026https://github.com/getsentry/sentry-python/issues/8027#event-35909689409
https://github.com/apps/sentry-junior
sentry-juniorhttps://github.com/apps/sentry-junior
on Nov 12, 2026https://github.com/getsentry/sentry-python/issues/8027#issuecomment-6823277437
getsentry/repro#61https://github.com/getsentry/repro/pull/61
#8261https://github.com/getsentry/sentry-python/pull/8261
sentrivanahttps://github.com/sentrivana
completedhttps://github.com/getsentry/sentry-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 18, 2026https://github.com/getsentry/sentry-python/issues/8027#event-36512256138
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-python/issues/8027
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/8027
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
Junior: reproJunior reproduces this bug and drafts a fixhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Junior%3A%20repro%22
PythonSDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Python%22
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.