Apply TIMEOUT_MULTIPLIER globally across codebase#5
Open
wittjeff wants to merge 1 commit intojrpool:mainfrom
Open
Apply TIMEOUT_MULTIPLIER globally across codebase#5wittjeff wants to merge 1 commit intojrpool:mainfrom
wittjeff wants to merge 1 commit intojrpool:mainfrom
Conversation
This change centralizes the TIMEOUT_MULTIPLIER environment variable and applies it consistently to all appropriate timeouts throughout Testaro. Changes: - Add procs/config.js as a shared module exporting timeoutMultiplier and an applyMultiplier() helper function - Update run.js to import from shared config and apply multiplier to 15 navigation/interaction timeouts (5000-15000ms range) - Update tests/alfa.js to use multiplier on networkidle wait (also increases base timeout from 2000ms to 6000ms for slow-loading sites) - Update tests/aslint.js to use multiplier on script evaluation timeout - Update tests/testaro.js to import from shared config instead of defining timeoutMultiplier locally - Update procs/screenShot.js to use multiplier on screenshot timeout - Update testaro/tabNav.js to use multiplier on click/keypress timeouts - Update testaro/hover.js to use multiplier on hover timeout Timeouts intentionally NOT modified (fail-fast operations): - tests/alfa.js boundingBox/innerText (50ms) - quick info gathering - procs/identify.js element ID (100ms) - quick element identification Usage: Set TIMEOUT_MULTIPLIER=2 (or higher) for slow networks/sites. Default value is 1 (no change to existing behavior). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Hi @jrpool, please send me the invitation again to join. I could not accept, please sendme the request to juans.casado@hotmail.com, and please let me know. |
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
This PR centralizes the
TIMEOUT_MULTIPLIERenvironment variable and applies it consistently to all appropriate timeouts throughout Testaro.Problem
Currently,
TIMEOUT_MULTIPLIERis only honored in two places:run.js- for tool-level time limitstests/testaro.js- for individual rule timeoutsMany other hardcoded timeouts (navigation, interactions, page loads) ignore this setting, making it impossible to adjust timing for slow networks or JavaScript-heavy sites.
Solution
Created
procs/config.js- A shared module that exports:timeoutMultiplier- the multiplier value from env var (default: 1)applyMultiplier(timeout)- helper function to apply the multiplierUpdated files to use the shared config:
run.jstests/alfa.jstests/aslint.jstests/testaro.jsprocs/screenShot.jstestaro/tabNav.jstestaro/hover.jstests/alfa.jsboundingBox/innerText (50ms)procs/identify.jselement ID (100ms)Usage
Default behavior is unchanged (
TIMEOUT_MULTIPLIER=1).Testing
applyMultiplier()function usesMath.round()to ensure integer timeout valuesRelated
This PR supersedes #4 (alfa timeout increase) by including that fix plus applying the multiplier globally.