Repository navigation
Tests: close leftover top-level widgets at session end (PySide6 6.12 exit crash) — v0.10.7 - #177
Merged
Merged
Conversation
…exit crash) — v0.10.7 PySide6 6.12.0 (released 2026-10-08) aborts the interpreter at shutdown when top-level widgets are still alive: PySide::destroyQCoreApplication destroys them after the suite has finished and Qt reports "QObject: shared QObject was deleted directly" followed by a segfault (exit 139 on Linux, 0xC0000409 on Windows). CI picked the new wheel up on the first run after its release, so every job now fails with all tests green — on master as much as on any PR. The suite leaves ~100 top-level widgets behind (Configuration tabs, FlyAppMainWindows, the ordering widget, combo-box popup frames, a tooltip). A new autouse session fixture closes and deletes them while the QApplication still exists and the event loop can deliver the deferred deletes, which is the order Qt expects: widgets first, application last. Verified on Python 3.14 with PySide6 6.12.0 (525 passed, exit 0; previously exit 0xC0000409) and with PySide6 6.11.1. PySide6 6.12.0 also declares requires-python <3.16, so the 3.15 job's --ignore-requires-python override and its note are dropped from the CI workflow and tox.ini, as that note said to do once a release declared 3.15 support. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #177 +/- ##
==========================================
+ Coverage 85.67% 85.70% +0.03%
==========================================
Files 74 74
Lines 6450 6450
==========================================
+ Hits 5526 5528 +2
+ Misses 924 922 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jamesabel
added a commit
to JingHao-Leon/pytest-fly
that referenced
this pull request
Oct 20, 2026
…mesabel#177) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
jamesabel
added a commit
that referenced
this pull request
Oct 20, 2026
* test: reproduce live-output cache ignoring max_bytes The decoded live-output cache is keyed by the file's (size, mtime_ns) only, but the text it holds is the *tail* of the file and therefore depends on max_bytes. A read with one byte limit can be served the tail computed for a different one. Adds two regression tests that fail on the current implementation: - a large-limit read after a small-limit read must not reuse the small tail - a small-limit read after a large-limit read must not return more than the limit * fix: key the live-output cache by the requested byte limit The decoded live-output cache was keyed by the log file's path alone, but the text it stores is the *tail* of that file, so the cached value also depends on the max_bytes limit the read was made with. The first call for a given file therefore fixed the length of the text every later call received. This is reachable in the app: the Table tab and the Live Output pane read the same log file with the 65536-byte default, while resolve_test_output() asks for 10,000,000 bytes. Whichever ran first decided how much output the others saw -- a read could return far fewer bytes than requested (with a spurious "...[truncated]..." marker) or far more than requested. Key the cache by (path, max_bytes) so each limit gets its own cached tail. Also bumps the version to 0.10.7. * Bump to 0.10.8: 0.10.7 was taken by the PySide6 6.12 teardown fix (#177) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: JamesAbel <j@abel.co> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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.
What was broken
CI has failed on every run since PySide6 6.12.0 was published (2026-10-08), including a plain re-run of the last green
mastercommit: all tests pass, then the pytest process dies at interpreter exit.Root cause
The suite leaves about 100 top-level widgets alive at session end:
Configurationtabs (tests/test_configuration.py,tests/test_gui_display.py),FlyAppMainWindows (tests/test_gui_widgets.py), anOrderingAspectsWidget, combo-box popup frames and a tooltip. Up to PySide6 6.11 these were destroyed silently during interpreter shutdown. From 6.12.0,PySide::destroyQCoreApplicationdestroys them after the application teardown has begun, Qt reports "shared QObject was deleted directly" and the process aborts (exit 139 on Linux,0xC0000409on Windows). Other projects report the identical failure and fix.The change
tests/conftest.py— a new autouse session fixture closes and deletes every remaining top-level widget while theQApplicationstill exists, then delivers the deferred deletes. Widgets first, application last, which is the order Qt expects. Existing tests are untouched..github/workflows/main.yml,tox.ini— PySide6 6.12.0 declaresrequires-python <3.16, so the 3.15 job's--ignore-requires-pythonoverride is dropped, as the note next to it said to do once a release declared 3.15 support.pyproject.toml— 0.10.7.Verification
Full suite, Python 3.14,
QT_QPA_PLATFORM=offscreen, exact process exit code captured:0xC0000409ruff checkandruff format --checkare clean.Unblocks #176.
🤖 Generated with Claude Code