aboutsummaryrefslogtreecommitdiffstats
path: root/test/runner/run.js
diff options
context:
space:
mode:
authorTimmy Willison <timmywil@users.noreply.github.com>2024-03-11 10:39:38 -0400
committerGitHub <noreply@github.com>2024-03-11 10:39:38 -0400
commit822362e6efae90610d7289b46477c7fa22758141 (patch)
tree523910c254ccb53f42a8fa7f45887d7a1ae983e3 /test/runner/run.js
parentae67ace649fd2ac49eb74709c3d0a5952d0dc3bb (diff)
downloadjquery-822362e6efae90610d7289b46477c7fa22758141.tar.gz
jquery-822362e6efae90610d7289b46477c7fa22758141.zip
Tests: add --hard-retries option to test runner
- Add the ability to retry by restarting the worker and getting a different browser instance, after all normal retries have been exhausted. This can sometimes be successful when a refresh is not. Close gh-5438
Diffstat (limited to 'test/runner/run.js')
-rw-r--r--test/runner/run.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/runner/run.js b/test/runner/run.js
index 4874fb6f9..0e13e015e 100644
--- a/test/runner/run.js
+++ b/test/runner/run.js
@@ -14,6 +14,7 @@ import { cleanupAllBrowsers, touchBrowser } from "./browserstack/browsers.js";
import {
addBrowserStackRun,
getNextBrowserTest,
+ hardRetryTest,
retryTest,
runAllBrowserStack
} from "./browserstack/queue.js";
@@ -30,6 +31,7 @@ export async function run( {
concurrency,
debug,
esm,
+ hardRetries,
headless,
isolate,
modules = [],
@@ -72,7 +74,7 @@ export async function run( {
// Create the test app and
// hook it up to the reporter
const reports = Object.create( null );
- const app = await createTestServer( ( message ) => {
+ const app = await createTestServer( async( message ) => {
switch ( message.type ) {
case "testEnd": {
const reportId = message.id;
@@ -120,6 +122,11 @@ export async function run( {
if ( retry ) {
return retry;
}
+
+ // Return early if hardRetryTest returns true
+ if ( await hardRetryTest( reportId, hardRetries ) ) {
+ return;
+ }
errorMessages.push( ...Object.values( pendingErrors[ reportId ] ) );
}