Repository navigation
Fail speech tests when a test callback throws - #6048
Merged
Merged
Conversation
added 4 commits
November 10, 2026 02:54
…ch-helper-errors # Conflicts: # __tests__/assets/esm/speech/speechPageObjects.js
Eugene (OEvgeny)
marked this pull request as ready for review
November 13, 2026 00:32
Eugene (OEvgeny)
requested review from
William Wong (compulim),
Chris Whitten (cwhitten) and
Thomas Durnford (tdurnford)
as code owners
November 13, 2026 00:32
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Speech failures are observed too late, so a throwing speakActor can leave the helper pending and the rejection unhandled when the actor waits for the utterance’s end event.
1 open issue
What changed in this PR
This PR improves speech-test reliability by propagating callback failures through the test helpers and awaiting recognition in two hook tests. It preserves the recognition frame delay introduced in #6040.
Changes:
- Coordinate recognition callbacks and propagate speech callback errors.
- Await recognition helpers in the start/stop dictation hook tests.
- Add a changelog entry documenting the fix.
| File | Description |
|---|---|
.changelog/6048-fix-test-speech-helper-errors.md |
Documents the speech-test reliability fix. |
__tests__/html2/hooks/useStopDictate.html |
Awaits the recognition helper. |
__tests__/html2/hooks/useStartDictate.html |
Awaits the recognition helper. |
__tests__/assets/esm/speech/speechPageObjects.js |
Updates callback completion and error propagation. |
Review effort: Balanced
An actor waiting for the utterance's end event never finished when the speak callback threw, so the test hung until timeout with an unhandled rejection.
William Wong (compulim)
approved these changes
Nov 13, 2026
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.

Changelog Entry
Fixed
Description
actRecognizeOnce()ran its actor inside anasyncPromise executor and resolved when recognition ended, so an actor error became an unhandled rejection: it failed the test only if it reached the console before the test finished, and a recognition callback error hung the test until timeout.actRecognizeOnce()now waits for both callbacks and rejects with the first error,actSpeakOnce()rethrows speak callback errors, and two hook tests nowawaitthe helper.Design
actSpeak()still turns a speak callback error into aSpeechSynthesisErrorEvent, becausestartRecognitionAfterFailedSynthesis.htmlthrows on purpose to simulate a failed synthesis.start()keeps the frame wait from Read the store with useSyncExternalStore() #6040 before it fires recognition events; only how its errors reach the test changed.Specific Changes
__tests__/assets/esm/speech/speechPageObjects.js:actRecognizeOnce()rejects when either callback throws;actSpeakOnce()rethrows errors from its speak callbackhooks/useStartDictate.html,hooks/useStopDictate.html:await actRecognizeOnce(…)I have added tests and executed them locally
I have added
.changelog/<PR#>-<slug>.mdI have updated documentation
Review Checklist
z-index)package.jsonandpackage-lock.jsonreviewed