From e37d4a675638ab812d3f70d4392c9ae8441bd431 Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Thu, 19 Feb 2026 14:15:19 +0800 Subject: [PATCH] Fix flaky window.scrollTo test The test is sensitive to any delay in running the schedule task exactly when it's scheduled. Testing this feature isn't worth making the build flaky. --- src/browser/tests/window/scroll.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/browser/tests/window/scroll.html b/src/browser/tests/window/scroll.html index fccddce0..657d8dac 100644 --- a/src/browser/tests/window/scroll.html +++ b/src/browser/tests/window/scroll.html @@ -37,6 +37,12 @@ restore(); testing.expectEqual(2, scrollevt); - testing.expectEqual(1, scrollendevt); + // This test used to assert that scrollendevt == 1. The idea being that + // the above resolve() would stop the test running after "scroll" fires but + // before "scrollend" fires. That timing is pretty sensitive/fragile. If + // the browser gets delayed and doesn't figure the scroll event exactly when + // schedule, it could easily execute in the same sheduler.run call as the + // scrollend. + testing.expectEqual(true, scrollendevt === 1 || scrollendevt === 2); });