Fail fast on 4xx navigation status (fixes testaro-tool hang on blocked pages) - #59
Fail fast on 4xx navigation status (fixes testaro-tool hang on blocked pages)#59wittjeff wants to merge 1 commit into
Conversation
When a navigation fails, launch() retries and, when retries are exhausted for the current browser, switches browser type (chromium -> webkit -> firefox) and resets the retry counter. For a persistent 4xx (e.g. a 403 WAF block) this runs ~11 launch+navigate attempts, most on the slow-to-launch WebKit/Firefox, and under the testaro tool's per-rule relaunch it compounds into a multi-minute / job-timeout stall on a single target. A 4xx client status is a definitive refusal that retrying and browser-switching cannot change, so skip the retry loop for 4xx — except 408 (Request Timeout) and 429 (Rate Limited), which are legitimately transient. 5xx, timeouts, and other transient failures are unaffected. Refs jrpool#48.
|
Thanks for addressing this problem, @wittjeff. Reproducing the issue on "toolTimes": {
"testaro": 67,
"alfa": 28,
"axe": 10,
"aslint": 9,
"ed11y": 8,
"ibm": 8,
"nuVnu": 8,
"qualWeb": 8,
"htmlcs": 7,
"nuVal": 7
},There is no timeout, the job completes, and the report is written with rule violations from all rule engines. Treating a 4xx as fatal would seem to prevent this useful result. If What about making Testaro learn from experience that repeated 4xx failures on one browser type should stop that browser type from being tried again? |
|
Version 76.2.0 now alters the value of the job property |
What
launch()fails fast on a 4xx navigation status instead of retrying it and switching browser types.Why (diagnosis for #48)
Investigating pages that hang testing (from #48 and our own corpus), I isolated the stall to a single tool. On
https://www.salesforce.com/, running each tool separately:The site returns 403 to the automated browser. In
launch(), a failed navigation retries, and when retries are exhausted for the current browser it switches browser type (chromium → webkit → firefox) and resets the retry counter. For a persistent 403 that's ~11 launch+navigate attempts, most on the slow-to-launch WebKit/Firefox — and because thetestarotool relaunches per rule, it compounds into a multi-minute (up to job-timeout) stall on one target. No other tool does per-rule relaunch, so onlytestarohangs.A 4xx is the server refusing — retrying and browser-switching can't change it. This change skips the retry loop for 4xx, except 408 (Request Timeout) and 429 (Rate Limited), which are legitimately transient (429 already has dedicated handling below). 5xx / timeouts / other transient failures are unchanged.
Verified
With the change,
salesforce.comfor thetestarotool returns in ~1 s (definitive block) instead of hanging. Not a full close of #48 — the 403 itself is a WAF-block question — but it removes the "prevent jobs from being completed" hang, which is one of #48's stated symptoms.