Repository navigation
Destroy the widgets of each test before the next one - #406
Merged
Merged
Conversation
A closed main window stayed alive until the next test created its own: it was referenced by the Web API controller, shared by all main windows, and by the SigimaX singleton instance, while the closed internal console, deleted later by Qt, was only deleted by the next event loop. The previous main window was then destroyed by the garbage collector at an arbitrary point of the next test, possibly amid Qt operations. - Web API: when its main window is closed, the controller no longer references it (nor its actions, which no longer receive server notifications), and stopping the server releases the workspace adapter - Tests: pending events and deferred deletions are processed after each test, then the garbage collector is run Requires the SigimaX fix releasing the closed main window as singleton instance (same branch name). Assisted-by: Claude Opus 5.5
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.
Main windows created by tests were destroyed at an arbitrary point of the next test, possibly amid Qt operations. This is a plausible cause of the intermittent segmentation fault seen on
developafter #402 (inside_by_side_app_test.py, right when the previous main window became garbage), although it is not proven: see #405 for the diagnostics.What kept a closed main window alive
SGMXMainWindow.get_instance)datalab.webapi), shared by all main windowsWA_DeleteOnClose), whose namespace references the main windowThe main window being part of reference cycles, it was then only destroyed when the garbage collector happened to run.
Changes
WebApiActions.cleanupdisconnects its actions from the shared controller (they could otherwise be notified by a server started from another window) and the controller releases the window (release_main_window). Stopping the server also releases the workspace adapter set for the routes, which references the main window.conftest.py): after each test, pending events and deferred deletions are processed, then the garbage collector is run.Validation
gc.collect()).features/image).