Skip to content

Commit fbb2a7d

Browse files
linesightclaude
andcommitted
osr_test: extend accessibility location-change grace period to 3 s
Python 3.14 is slow enough that the previous 1 s unconditional extra wait was still insufficient for the OnAccessibilityLocationChange IPC to arrive before check_auto_asserts ran. Replace the single fixed-length wait with a polling loop: up to 30 batches of 10 iterations (100 ms each) = 3 s maximum, but exits immediately once the flag is set. Fast runners (3.10-3.13) continue to pay nothing extra; 3.14 gets as much time as it needs up to 3 s. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c00da18 commit fbb2a7d

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

unittests/osr_test.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,14 @@ def test_osr(self):
186186
run_message_loop()
187187

188188
# 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)
189+
# can lag behind OnAccessibilityTreeChange on slow CI runners (e.g.
190+
# Python 3.14 adds enough overhead that 1 s was insufficient).
191+
# Poll in 100 ms batches, up to 3 extra seconds, and exit as soon as
192+
# the flag is set so fast runners pay nothing extra.
193+
for _ in range(30):
194+
if accessibility_handler._OnAccessibilityLocationChange_True:
195+
break
196+
do_message_loop_work(10)
193197

194198
# Close browser and clean reference
195199
browser.CloseBrowser(True)

0 commit comments

Comments
 (0)