fix: observe retained sessions without blocking independent libraries

This commit is contained in:
阿白叔 committed 2026-11-06 15:42:40 +08:00
1 parent 6278091f21
commit cb11624b68
9 files changed
+134 -7

No files matched your search

+19
View File
@@ -8,6 +8,25 @@ from PySide6.QtCore import QTimer
from test_ui_filters import load_window
def test_late_lease_callback_does_not_refresh_destroyed_view(qtbot, tmp_path, monkeypatch):
import shiboken6
window = load_window(qtbot, tmp_path, monkeypatch)
entered, release = Event(), Event()
def action():
entered.set()
assert release.wait(3)
try:
window._lease_action(action)
qtbot.waitUntil(entered.is_set)
window.cbb_table.deleteLater()
qtbot.waitUntil(lambda: not shiboken6.isValid(window.cbb_table))
release.set()
qtbot.waitUntil(lambda: window._lease_pending == 0)
finally:
release.set()
window.pool.waitForDone(3000)
def slow_lease(main_thread):
entered, release, closed = Event(), Event(), Event()
calls = []