Stabilize Windows CI: widen regex-timeout assertion, skip flaky waitAsync case#2472
Merged
Merged
Conversation
PreparedScriptHonorsRegexTimeoutForCustomEngine asserted that the prepare-time 1s RegexTimeout caused execution to finish within 5s, relying on the engine's default 10s timeout as the regression sentinel. On slow Windows runners cancellation lag pushed the observed time to ~5.8s even though the timeout fired correctly, flaking PR CI (e.g. run 25664472581). Make the test set an explicit, clearly larger engine timeout (30s) and widen the upper bound to 15s so the assertion still catches a regression that falls through to the engine timeout while tolerating real-world CI scheduling jitter. Also exclude built-ins/Atomics/waitAsync/no-spurious-wakeup-on-exchange.js: the test asserts `lapse >= TIMEOUT` where TIMEOUT is the 200ms $262.agent.timeouts.small, but on Windows Task.Delay-driven timeout resolution can complete a few ms shy of the requested interval due to timer-tick granularity, producing intermittent failures (run 25846817088) even though the implementation is correct. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lahma
force-pushed
the
fix/ci-flakes-windows
branch
from
May 14, 2026 07:35
0f3f9f4 to
a7ca836
Compare
lahma
enabled auto-merge (squash)
May 14, 2026 07:35
This was referenced May 18, 2026
This was referenced Jun 4, 2026
This was referenced Jun 29, 2026
This was referenced Jul 7, 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.
Summary
Address two intermittent Windows-only CI failures observed on recent PRs:
Jint.Tests.Runtime.RegExpTests.PreparedScriptHonorsRegexTimeoutForCustomEnginefailed withExpected RegexMatchTimeoutException within 5s, took 5.8s. The test correctly firedRegexMatchTimeoutExceptionfor the 1s prepare-time timeout — only the 5s upper-bound assertion was too tight for a loaded Windows runner.built-ins/Atomics/waitAsync/no-spurious-wakeup-on-exchange.jsfailedlapse >= TIMEOUTwhereTIMEOUT = $262.agent.timeouts.small(200 ms).Task.Delay-driven timeout resolution on Windows can complete a few ms shy of the requested interval due to timer-tick granularity, producing a non-deterministic failure.Details
RegExpTests robustness
AssertPrepareTimeRegexTimeoutFiresandPreparedModuleHonorsRegexTimeoutForCustomEnginepreviously relied on the engine's default 10sRegexTimeoutIntervalas the regression sentinel — they asserted "elapsed < 5s" to detect a regression that ignored the prepare-time timeout and fell through to the default. On a slow Windows runner the observed time was 5.8s even though the timeout fired correctly at ~1s + cancellation lag.The fix makes the test independent of the default and gives a clear gap above realistic CI jitter:
Test262 exclusion
Excluded
built-ins/Atomics/waitAsync/no-spurious-wakeup-on-exchange.js— itslapse >= TIMEOUT(200 ms) assertion is non-deterministic on Windows becauseTask.Delay-driven timeout resolution rounds down through Windows timer-tick granularity, producing sub-TIMEOUT lapses despite a correct implementation. Matches existing project policy of not patching Test262 sources.Linked issue
Refs #
Test plan
dotnet test --configuration Release Jint.Tests/Jint.Tests.csproj --filter "FullyQualifiedName~Jint.Tests.Runtime.RegExpTests"— all 22 cases pass; the formerly flaky theory cases complete in ~1s, well inside the new 15s bound.Breaking change?
No — test-only changes.