feat(runtime): track promises and report test timeouts#138
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Add release planning notes for runtime test timeout reporting in PR 138.
Remove historical behavior framing from bridgeTimeout documentation.
Extend runtime timeout reporting to beforeAll and afterAll hooks, surface suite-level timeout errors in Jest results, and restart the app after any runtime timeout.
This was referenced Jun 3, 2026
Add a Harness-level testTimeout config value and use it as the runtime timeout fallback when Jest does not provide one. Document the option and cover the precedence behavior in Jest package tests.
Use Harness config testTimeout ahead of Jest timeout settings and update docs/tests to describe the precedence.
Propagate promise tracker test context through promise chains and omit Harness wrapper promises from timeout diagnostics.
Skip teardown and final assertion flushing when timed-out test work resumes after the timeout result has already been reported.
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.
What is this?
This PR improves how React Native Harness handles stalled async work in runtime tests. Instead of letting a long-running
runTestsbridge RPC time out and fail the whole file generically, Harness now reports the exact test case that timed out and tracks pending promises with their creation context.How does it work?
The bridge no longer applies the generic RPC timeout to
runTests; after the app connects, connection health is determined by heartbeat traffic. Jest passes the configured test timeout into the runtime, where each active test case is wrapped with a runtime timeout. When a test case times out, Harness emits a failed result for that case, synthesizes skipped results for the rest of the file, and restarts the app so leaked async work does not carry into later files or watch-mode runs.The runtime also installs a Promise tracker that records pending promises, stack traces, and active test context while avoiding Harness's own timeout bookkeeping promises.
Why is this useful?
Reviewers and users can distinguish a healthy-but-stuck test case from a broken bridge or crashed runtime. Timeout reports now point at the specific test that stalled, remaining tests in the file are not run in a contaminated environment, and pending promise metadata gives a concrete starting point for diagnosing unresolved async work.