Raise the RequireJS and Mocha timeouts of the UI unit tests - #1148
Merged
vharseko merged 1 commit intoSep 29, 2026
Merged
Conversation
The first karma test on the Windows runner failed with a RequireJS "Load timeout for modules" after 7.049 s: the default waitSeconds of 7 was hit while the "before" hook of RESTLoginHelperTest loaded the module under test through Squire. Its 6 s Mocha timeout had not fired yet, so the runner held back the browser's timers; raising waitSeconds alone would turn the same stall into a Mocha timeout. Set waitSeconds to 60 (Squire copies it into every context it creates) and the Mocha timeout to 30 s, keeping the Mocha limit below the RequireJS one so a slow load inside a test is reported by Mocha.
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.
Problem
build-maven (windows-latest, 11)on master (run 36570003414) failed inopenam-ui-riaon the very first karma test:The error came after 7.049 s, which is RequireJS's default
waitSecondsof 7:test-main.jsdoes not set it. The other 146 tests loaded the same modules without trouble, and the triggering commit (#1147) only bumps GitHub Actions versions. So this is a slow cold start on the runner, not a broken module.The hook's Mocha timeout (6 s,
karma.conf.js) should have fired before the 7 s RequireJS limit, but it had not. That means the runner held back the browser's timers, so raisingwaitSecondsalone would only turn the same stall into a Mocha timeout.Change
src/test/js/test-main.js:waitSeconds: 60. Squire copies the default context's config, this value included, into every context it creates, so it covers thebeforehooks too.karma.conf.js: Mochatimeout6000 → 30000. It stays belowwaitSeconds, so a slow load inside a test is reported by Mocha, and the RequireJS limit only bounds the initial load of the test files. A missing module (404) still fails at once through RequireJS's script error, not through the timeout.Testing
mvn -pl openam-ui/openam-ui-ria verifylocally:TOTAL: 151 SUCCESS,BUILD SUCCESS.