Repository navigation
fix(tests): stop the game detection popup tests segfaulting Ubuntu CI - #85
Open
kalopsia-space wants to merge 1 commit into
Open
kalopsia-space wants to merge 1 commit into
kalopsia-space wants to merge 1 commit into
Conversation
GameDetectionPopup queues _refresh_running_windows with QTimer.singleShot(0). In the tests that patch sys.platform to 'win32' on Linux, that slot reaches ctypes.windll and raises AttributeError. PySide6 6.11 keeps a slot error raised inside a Python-driven QApplication.processEvents() pending; the next Python virtual it dispatches in the same pass (IconButton/_ToggleSwitch paintEvent) then segfaults in Shiboken::BindingManager::getOverride, killing the whole single-process pytest run on Ubuntu. Stub _enumerate_capturable_windows for the module so the deferred refresh neither raises nor shells out to hyprctl/xdotool.
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.
Problem
On
linux-2.0the Ubuntu Python 3.12 and 3.14Testssteps segfault intests/test_game_detection_popup.py(run 39039653469). The crash kills the single-process pytest run at about 41%, so no Linux test after that point reports anything.Root cause
GameDetectionPopup._build_uiqueues_refresh_running_windowswithQTimer.singleShot(0).test_removing_rules_clears_nested_row_widgetspatchessys.platformto'win32', then callspopup.show()andqapp.processEvents().processEvents()the queued slot runs_enumerate_capturable_windows(). That takes the Win32 branch, andctypes.windllraisesAttributeErroron Linux.processEvents(). The next Python virtual dispatched in the same pass is thepaintEventoverride ofIconButtonor_ToggleSwitch. It crashes inside Shiboken's override lookup.Native stack (faulthandler, which the app's crash logging redirects to
$HOME/.fthr/logs/fthr-crash.log; gdb gives the same frames):Bisection (stand-alone script, offscreen):
sys.platform == 'win32'at paint time. Setting it only during construction is fine.QTimer.singleShot(0, slot), aQPushButtonsubclass with a PythonpaintEvent, thenapp.processEvents().QPushButtonthere is no crash;processEvents()re-raises theAttributeErrorinstead.app.exec()the error is printed and the loop continues. The shipped app is not affected; only tests that pumpprocessEvents()from Python can hit it.Fix
An autouse fixture in
tests/test_game_detection_popup.pystubscapture_settings_widget._enumerate_capturable_windowsto[]. The deferred refresh then neither raises nor shells out tohyprctl/xdotoolfrom a test.test_windows_running_window_can_be_added_and_blockedstill installs its own stub on top. No product code changes and no Windows behaviour change.Local verification (Arch, Python 3.14.8, PySide6 6.11.1, offscreen, isolated HOME, CI command and ignore list)
35 failed, 1702 passed, 27 skipped in 81.7s. The run finishes, andtest_editor_sessions.pyalso passes in-process. The remaining failures are real test failures, not crashes, and are out of scope here:test_game_detection_popup::test_browse_executable_adds_and_persists_game:_validate_game_selectionstill requires.exeon Linux. This is a real 2.0 UI bug that the segfault was hiding.test_capture_backend_detection::test_binary_exists: local only, because the engine is not built locallyruff check .is clean andtools/verify_exception_handling.pypasses.