-
Notifications
You must be signed in to change notification settings - Fork 21
SG-42069 Fix random segfault by controlling Qt object destruction order #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
33c0378
SG-38851: Use tk-ci-tools branch that targets tk-core segfault fix
julien-lang ad16887
Tests
julien-lang 407ebf9
skip this one for now
julien-lang aa089db
SG-38851: Fix segfault by explicitly disconnecting Qt signals in tear…
julien-lang bd9e1a7
tests
julien-lang 37f1b44
Fix tearDown to check for real Qt signals vs mocks
julien-lang 52132a8
Fix production code: disconnect Qt signals in shut_down()
julien-lang 879b432
tests
julien-lang e0c8f83
Remove tk-ci-tools branch dependency to minimize diff
julien-lang 9946c47
more tests
julien-lang fe9686f
revert
julien-lang a0fda61
black
julien-lang 1db004c
Add hasattr checks for mocked signals in shut_down()
julien-lang 96fb27d
Move signal disconnection fix to test-only code
julien-lang eb71b99
Fix hasattr checks - verify parent object has attribute first
julien-lang 3adcd0d
Skip disconnect for _MockedSignal instances
julien-lang 7db82ec
tests
julien-lang 7849910
black
julien-lang 6df3e16
Increase schema cache test timeout for Python 3.13
julien-lang 2f33030
SG-38851: Increase timeout for Python 3.13+ background tasks
julien-lang 9fb4739
fixup! SG-38851: Increase timeout for Python 3.13+ background tasks
julien-lang 81cb464
Cleanups
julien-lang f7a105c
fixup! Cleanups
julien-lang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| # agreement to the Shotgun Pipeline Toolkit Source Code License. All rights | ||
| # not expressly granted therein are reserved by Shotgun Software Inc. | ||
|
|
||
| import sys | ||
| import time | ||
|
|
||
| from unittest import mock | ||
|
|
@@ -138,11 +139,16 @@ def _trigger_cache_load(self): | |
|
|
||
| # The schema is loaded by a background thread, so we'll have to process events so the results can more in. | ||
| before = time.time() | ||
|
julien-lang marked this conversation as resolved.
|
||
|
|
||
| timeout = 5 if sys.version_info >= (3, 13) else 2 | ||
| # Python 3.13+ has different threading/GIL behavior that can make background | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😍 |
||
| # tasks slower on some platforms (especially macOS). | ||
|
|
||
| while ( | ||
| self._cached_schema._is_schema_loaded() is False | ||
| or self._cached_schema._is_status_loaded() is False | ||
| ): | ||
| self._qapp.processEvents() | ||
|
julien-lang marked this conversation as resolved.
|
||
| assert ( | ||
| before + 2 > time.time() | ||
| before + timeout > time.time() | ||
|
julien-lang marked this conversation as resolved.
|
||
| ), "Timeout, schema shouldn't take this long to load from Mockgun." | ||
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.
Uh oh!
There was an error while loading. Please reload this page.