Skip to content

Commit c00da18

Browse files
linesightclaude
andcommitted
Fix flaky OSR test: wait for OnAccessibilityLocationChange on slow CI
OnAccessibilityTreeChange and OnAccessibilityLocationChange are driven by two separate renderer Mojo IPC messages. The tree change fires when the DOM is committed; the location change fires later, after layout computes pixel positions. On Linux CI (Xvfb + --in-process-gpu + software rendering), the location-change IPC can arrive just past the standard 2-second message loop window because each BeginFrame cycle requires a cross-thread roundtrip between the in-process GPU/compositor thread and the UI thread. Windows CI is unaffected due to faster IPC dispatch margins. Add a bounded 1-second extra pump that only activates when the flag is not yet set, so passing runs pay nothing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d9ab1f4 commit c00da18

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

unittests/osr_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ def test_osr(self):
185185
# Message loop
186186
run_message_loop()
187187

188+
# OnAccessibilityLocationChange arrives via a separate renderer IPC and
189+
# can lag behind OnAccessibilityTreeChange on slow CI runners. Give it
190+
# up to 1 extra second before closing the browser.
191+
if not accessibility_handler._OnAccessibilityLocationChange_True:
192+
do_message_loop_work(100)
193+
188194
# Close browser and clean reference
189195
browser.CloseBrowser(True)
190196
del browser

0 commit comments

Comments
 (0)