Skip to content

Commit bdc7209

Browse files
committed
test: collect on the GUI thread in the tab keep-alive probe
The probe built every tab without the GuiThreadCollector that start_autocontrol_gui installs, so a collection a tab's worker thread triggered could reach a dropped tab's Qt objects: an access violation on Windows 3.11 CI (run 45762926172) while the Audit Log worker queried. The probe now runs tabs the way the application does.
1 parent 792b4e5 commit bdc7209

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎test/unit_test/headless/test_gui_tab_not_kept_alive.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
os.environ["AUTOCONTROL_GUI_SETTINGS"] = "off"
2424
from PySide6.QtWidgets import QApplication
2525
app = QApplication.instance() or QApplication([])
26+
# As start_autocontrol_gui() does: the tabs' workers run Python, and a cyclic collection a worker
27+
# triggered could reach a dropped tab's Qt objects (an access violation on Windows 3.11 CI).
28+
from je_auto_control.gui._gui_thread_gc import GuiThreadCollector
29+
collector = GuiThreadCollector(app)
2630
from je_auto_control.gui.tab_registry import TAB_SPECS
2731
2832
def build(spec, delete):

0 commit comments

Comments
 (0)