Title: CI: graph-lifetime tests flaky on free-threaded 3.14t jobs since #2371 · Issue #2403 · NVIDIA/cuda-python · GitHub
Open Graph Title: CI: graph-lifetime tests flaky on free-threaded 3.14t jobs since #2371 · Issue #2403 · NVIDIA/cuda-python
X Title: CI: graph-lifetime tests flaky on free-threaded 3.14t jobs since #2371 · Issue #2403 · NVIDIA/cuda-python
Description: Describe the bug Since #2371 merged (2026-07-15 16:55 UTC), CI is flaky on free-threaded Python 3.14t test jobs: four tests in cuda_core/tests/graph/test_graph_definition_lifetime.py intermittently fail with AssertionError: condition not...
Open Graph Description: Describe the bug Since #2371 merged (2026-07-15 16:55 UTC), CI is flaky on free-threaded Python 3.14t test jobs: four tests in cuda_core/tests/graph/test_graph_definition_lifetime.py intermittently...
X Description: Describe the bug Since #2371 merged (2026-07-15 16:55 UTC), CI is flaky on free-threaded Python 3.14t test jobs: four tests in cuda_core/tests/graph/test_graph_definition_lifetime.py intermittently...
Opengraph URL: https://github.com/NVIDIA/cuda-python/issues/2403
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CI: graph-lifetime tests flaky on free-threaded 3.14t jobs since #2371","articleBody":"## Describe the bug\n\nSince #2371 merged (2026-07-15 16:55 UTC), CI is flaky on **free-threaded Python 3.14t** test jobs: four tests in [`cuda_core/tests/graph/test_graph_definition_lifetime.py`](https://github.com/NVIDIA/cuda-python/blob/58f87330386f672cf29c716ca84ba8e832967300/cuda_core/tests/graph/test_graph_definition_lifetime.py) intermittently fail with\n\n```\nAssertionError: condition not satisfied within 5.0s\n```\n\nraised by the [`_wait_until`](https://github.com/NVIDIA/cuda-python/blob/58f87330386f672cf29c716ca84ba8e832967300/cuda_core/tests/graph/test_graph_definition_lifetime.py#L52-L75) polling helper ([`_FINALIZE_TIMEOUT = 5.0`](https://github.com/NVIDIA/cuda-python/blob/58f87330386f672cf29c716ca84ba8e832967300/cuda_core/tests/graph/test_graph_definition_lifetime.py#L29)):\n\n- `test_kernel_args_buffer_lifetime` (added in #2041)\n- `test_memcpy_buffer_allocations_released_after_graph_destroyed` (#2280)\n- `test_slot_owners_released_after_graph_destroyed` (#2280)\n- `test_pending_call_queue_saturation_preserves_cleanup` (#2371)\n\n## Impact (2026-07-15 → 2026-07-21)\n\nSurvey of all Actions runs 2026-06-15 → 2026-07-22 (246 failed/re-run runs classified by job-log signature):\n\n- **16 of 77 CI runs (~21%) hit this signature**, including 5 runs on `main` (push + scheduled). 11 were on PRs touching nothing near graph code (e.g. #2374, #2402).\n- 7 of the 16 were re-run to green — one needed [6 attempts](https://github.com/NVIDIA/cuda-python/actions/runs/29602432384) — so red-run counts understate it.\n- **Zero occurrences** in ~300 completed runs 2026-06-15 → 2026-07-14. #2280 (merged 2026-07-07) ran clean for 8 days; the first hit is 4.5 h after #2371 merged (2026-07-15 21:26 UTC, [run 29451966527](https://github.com/NVIDIA/cuda-python/actions/runs/29451966527)).\n- Only 3.14t jobs are affected — across win-64 / linux-64 / linux-aarch64, CUDA 12.9.1 / 13.0.2 / 13.3.0, local & wheels, T4 / L4 / A100. Never observed on regular-GIL jobs.\n\n## Failing jobs (all 18 instances)\n\n| Failing CI pipeline | CI log |\n|---|---|\n| Test win-64 / Python 3.14t, CUDA 13.0.2 (wheels), GPU a100 (MCDM) | [2026-07-15 · PR 2374](https://github.com/NVIDIA/cuda-python/actions/runs/29451966527/job/87480738831) |\n| Test win-64 / Python 3.14t, CUDA 13.0.2 (wheels), GPU a100 (MCDM) | [2026-07-16 · PR 2242](https://github.com/NVIDIA/cuda-python/actions/runs/29499296934/job/87629352733) |\n| Test linux-aarch64 / Python 3.14t, CUDA 13.0.2 (wheels), GPU a100 | [2026-07-17 · PR 2379](https://github.com/NVIDIA/cuda-python/actions/runs/29584165382/job/87899244042) |\n| Test win-64 / Python 3.14t, CUDA 13.0.2 (wheels), GPU a100 (MCDM) | [2026-07-17 · main](https://github.com/NVIDIA/cuda-python/actions/runs/29555550182/job/87809528510) |\n| Test win-64 / Python 3.14t, CUDA 13.0.2 (wheels), GPU a100 (MCDM) | [2026-07-17 · main](https://github.com/NVIDIA/cuda-python/actions/runs/29602432384/job/87962162694) |\n| Test win-64 / Python 3.14t, CUDA 13.0.2 (wheels), GPU a100 (MCDM) | [2026-07-19 · main](https://github.com/NVIDIA/cuda-python/actions/runs/29666641194/job/88139923507) |\n| Test linux-64 / Python 3.14t, CUDA 12.9.1 (local), GPU t4 | [2026-07-20 · PR 2390](https://github.com/NVIDIA/cuda-python/actions/runs/29724266375/job/88295548106) |\n| Test linux-64 / Python 3.14t, CUDA 13.0.2 (local), GPU l4 | [2026-07-20 · PR 2242](https://github.com/NVIDIA/cuda-python/actions/runs/29768699624/job/88444074974) |\n| Test linux-aarch64 / Python 3.14t, CUDA 13.0.2 (wheels), GPU a100 | [2026-07-20 · main](https://github.com/NVIDIA/cuda-python/actions/runs/29719293380/job/88279928623) |\n| Test win-64 / Python 3.14t, CUDA 13.0.2 (wheels), GPU a100 (MCDM) | [2026-07-20 · PR 2242](https://github.com/NVIDIA/cuda-python/actions/runs/29768699624/job/88446543396) |\n| Test win-64 / Python 3.14t, CUDA 13.0.2 (wheels), GPU a100 (MCDM) | [2026-07-20 · PR 2394](https://github.com/NVIDIA/cuda-python/actions/runs/29777373005/job/88475693911) |\n| Test linux-64 / Python 3.14t, CUDA 12.9.1 (local), GPU t4 | [2026-07-21 · PR 2398](https://github.com/NVIDIA/cuda-python/actions/runs/29849525172/job/88701835631) |\n| Test linux-64 / Python 3.14t, CUDA 12.9.1 (local), GPU t4 | [2026-07-21 · PR 2402](https://github.com/NVIDIA/cuda-python/actions/runs/29876578909/job/88790610219) |\n| Test linux-aarch64 / Python 3.14t, CUDA 13.3.0 (local), GPU l4 | [2026-07-21 · main](https://github.com/NVIDIA/cuda-python/actions/runs/29846402084/job/88690759075) |\n| Test linux-aarch64 / Python 3.14t, CUDA 13.3.0 (local), GPU l4 | [2026-07-21 · PR 2383](https://github.com/NVIDIA/cuda-python/actions/runs/29855714919/job/88722171657) |\n| Test win-64 / Python 3.14t, CUDA 12.9.1 (local), GPU l4 (TCC) | [2026-07-21 · PR 2390](https://github.com/NVIDIA/cuda-python/actions/runs/29796301934/job/88530809561) |\n| Test win-64 / Python 3.14t, CUDA 13.0.2 (wheels), GPU a100 (MCDM) | [2026-07-21 · PR 2392](https://github.com/NVIDIA/cuda-python/actions/runs/29825220814/job/88621734327) |\n| Test win-64 / Python 3.14t, CUDA 13.0.2 (wheels), GPU a100 (MCDM) | [2026-07-21 · PR 2398](https://github.com/NVIDIA/cuda-python/actions/runs/29849525172/job/88704708482) |\n\n(Excluded from the count: graph PRs failing their own branches — #2280, #2333, #2357 — and the 2026-07-17 gb300 nightly, which failed machine-wide with `ValueError: Cannot set NULL context as current` and looks unrelated.)\n\n## How to Reproduce\n\nNo deterministic local repro; it fires in roughly 1 in 5 CI runs on any 3.14t GPU test job since 2026-07-15. The four tests above are the ones to stress.\n\n## Expected behavior\n\nGraph-lifetime cleanup assertions pass reliably on free-threaded builds.\n\n## Likely mechanism\n\n#2371 defers user-object payload cleanup through a pending-call queue. On free-threaded Python (deferred reference counting), on a loaded runner, cleanup can lag past the 5 s `_FINALIZE_TIMEOUT` budget, so assertions observing release (weakref death, allocation counters, queue drain) time out. Three of the four tests predate #2371 and only began flaking once it landed.\n\nPossible directions:\n\n- Raise `_FINALIZE_TIMEOUT` on free-threaded builds (it is already 30 s under compute-sanitizer).\n- Make `_wait_until` actively drive the pending-call queue instead of only `gc.collect()` + sleep.\n- Bound cleanup latency in the implementation (e.g. drain the queue opportunistically on API calls).\n\n-- Leo's bot\n","author":{"url":"https://github.com/leofang","@type":"Person","name":"leofang"},"datePublished":"2026-07-22T01:27:34Z","url":"https://github.com/NVIDIA/cuda-python/issues/2403"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:eba71765-f3d3-dcea-11d4-6394eecd3975 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BBD8:1E9825:E7038:1441A5:6AF8340D |
| html-safe-nonce | 12c6e62ca87838a6c2981195727cd6df6f958a946f859bda000cd854cca18ec6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkQ4OjFFOTgyNTpFNzAzODoxNDQxQTU6NkFGODM0MEQiLCJ2aXNpdG9yX2lkIjoiMjk1NzMyMDgzNDYyOTc3NjM5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 45742e603e972ac8a61756e9177849d17fcc1b72240036dfb175a716a4c1c310 |
| hovercard-subject-tag | issue:4944499379 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NVIDIA/cuda-python/2403/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e6ba6acef95f25475b8f7b17786958220ef12796173cdbef1baf15e8051885c6/NVIDIA/cuda-python/issues/2403 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e6ba6acef95f25475b8f7b17786958220ef12796173cdbef1baf15e8051885c6/NVIDIA/cuda-python/issues/2403 |
| og:image:alt | Describe the bug Since #2371 merged (2026-07-15 16:55 UTC), CI is flaky on free-threaded Python 3.14t test jobs: four tests in cuda_core/tests/graph/test_graph_definition_lifetime.py intermittently... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | leofang |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5713ecd83001b2f55c3509fb7a292bf7d66d0f167c7ae87a9f7eaec5a52bf8db |
| turbo-cache-control | no-preview |
| go-import | github.com/NVIDIA/cuda-python git https://github.com/NVIDIA/cuda-python.git |
| octolytics-dimension-user_id | 1728152 |
| octolytics-dimension-user_login | NVIDIA |
| octolytics-dimension-repository_id | 381173759 |
| octolytics-dimension-repository_nwo | NVIDIA/cuda-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 381173759 |
| octolytics-dimension-repository_network_root_nwo | NVIDIA/cuda-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 653be32ff5c755082a4db662491bfbbcfc9112c1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width