Open
Conversation
- Run entire test on a separate thread so gtest can detect deadlock via timeout without hanging the process - Install hook after initialization instead of using enable flag - Use plain bool for hookSignaled (single-thread access) - Move unique_ptr into test thread (single owner) - Update comments and flow diagram to match code Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the AppRuntime destructor deadlock regression test (originally added in #147) to make deadlock detection reliable by letting the gtest thread time out while the destructor runs on a separate worker thread.
Changes:
- Move the runtime lifecycle (create → init → hook → destroy) into a dedicated thread so the main test thread can detect deadlock via timeout.
- Install the arcana before-wait hook after initialization and simplify hook signaling state.
- Update test comments/flow diagram to match the new control flow.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bghgary
added a commit
to bghgary/JsRuntimeHost
that referenced
this pull request
Apr 9, 2026
Reverts the deadlock fix to demonstrate the test detects it. Test updated with cleanup from BabylonJS#151. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bump arcana.cpp GIT_TAG to b9bf9d85fce37d5fc9dbfc4a4dc5e1531bee215a which renames ARCANA_TESTING_HOOKS to ARCANA_TEST_HOOKS and moves hooks to arcana::test_hooks::blocking_concurrent_queue namespace. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Clean up the deadlock regression test from #147.
Changes
Verified locally: passes with fix, detects deadlock with old destructor, exits cleanly in both cases.