Repository navigation
Fix flaky html2 tests with deterministic waits - #5894
Merged
Merged
Conversation
added 2 commits
October 17, 2026 09:00
- fluentTheme/carousel.html: wait for the bot response and its images before the first snapshot, the response could arrive during the snapshot and the card images were captured blank. - markdown/codeBlockCopyButton/behavior.denied.html: the copy button checks the clipboard permission asynchronously, wait for aria-disabled with waitFor(). - attachment/adaptiveCard/custom.*.html: wait for the bot responses and the scroll before each snapshot, and for the response to each click before the next click. The wait for the 3 buttons now uses expect(). - activity/viewCodeButton.scroll.html: wait for each keyboard scroll to end before the next ARROW_DOWN, Chrome may drop a keyboard scroll that arrives while the previous smooth scroll is ending. - activity/legacy/unknownActivity.html, unknownAttachment.html: wait for the console error and the telemetry exception event, the exception is tracked in an effect after the error box is rendered.
Eugene (OEvgeny)
marked this pull request as ready for review
October 17, 2026 22:01
Eugene (OEvgeny)
requested review from
William Wong (compulim),
Chris Whitten (cwhitten) and
TJ Durnford (tdurnford)
as code owners
October 17, 2026 22:01
William Wong (compulim)
approved these changes
Oct 18, 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
Not required, development only.
Description
Six html2 tests failed intermittently on CI or under load because they asserted or took a snapshot before asynchronous work had finished. Each test now waits for the state it checks, with
waitFor()from@testduet/wait-foror existing page conditions. There are no retries and no sleeps. Snapshots are unchanged.fluentTheme/carousel.htmlmarkdown/codeBlockCopyButton/behavior.denied.htmlnavigator.permissions.query()before it setsaria-disabled, but the test asserted right after pressing ENTERwaitFor()onaria-disabledattachment/adaptiveCard/custom.*.htmlpostActivity()resolves before Web Chat renders the bot response. The snapshots only waited until the screen stopped changing, so the response could be missing if rendering was late.activity/viewCodeButton.scroll.htmlscrollendafter each key pressactivity/legacy/unknownActivity.htmlnumActivitiesShown(2)waitFor()on the console error and on the exception event, as inunknownAttachment.htmlDesign
behavior.denied.htmlwas converted from a Babel script to a module script so that it can importwaitFor(), as thefeedbackFormtests do. The JSX is nowcreateElement()and renders the same DOM.custom.*.htmluses the existingpageConditions.scrollToBottomCompleted(). This helper includes a 500 ms settle time. Locally, each variant took 17–20 s both before and after the change.unknownAttachment.htmlasserted its telemetry exception event without waiting, which has the same race. It now waits too.custom.skip.htmlreturned a boolean, sowaitFor()never retried. It now usesexpect().Follow-ups (not seen failing on CI, not changed here):
markdown/codeBlockCopyButton/behavior.html,behavior.highlighted.htmlandadaptiveCards/behavior.htmltake the "Copied" snapshot right after ENTER, but the "Copied" state is also set asynchronously. With the permission query delayed by 200 ms, the snapshot differs.Specific Changes
fluentTheme/carousel.html: wait fornumActivitiesShown(2)andallImagesLoaded()before the first snapshotmarkdown/codeBlockCopyButton/behavior.denied.html: module script,waitFor()onaria-disabledattachment/adaptiveCard/custom.skip.html(shared bycustom.{copilot,fluent}[.dark].html):numActivitiesShown()andscrollToBottomCompleted()before each snapshot and after each click,expect()in the existingwaitFor()activity/viewCodeButton.scroll.html: wait forscrollendafter each ARROW_DOWNactivity/legacy/unknownActivity.html,unknownAttachment.html:waitFor()on the console error and the telemetry exception eventI have added tests and executed them locally
I have updated
CHANGELOG.mdI have updated documentation
Review Checklist
z-index)package.jsonandpackage-lock.jsonreviewed