From fdbda659775b96ae7e37093d9481ffcce551228c Mon Sep 17 00:00:00 2001 From: dmail Date: Tue, 20 Aug 2024 00:56:09 +0200 Subject: [PATCH] small update --- packages/related/test/scripts/test.mjs | 30 +++++++++---------- .../test/src/execution/execute_test_plan.js | 6 +++- scripts/test/test.mjs | 10 +------ 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/packages/related/test/scripts/test.mjs b/packages/related/test/scripts/test.mjs index 183b241856..ae9eb2555a 100644 --- a/packages/related/test/scripts/test.mjs +++ b/packages/related/test/scripts/test.mjs @@ -6,21 +6,21 @@ await executeTestPlan({ "./tests/**/*.test.mjs": { node: { runtime: nodeWorkerThread(), - }, - }, - "./tests/**/coverage_browsers_and_node.test.mjs": { - node: { - allocatedMs: 60_000, - }, - }, - "./tests/**/browser_tabs.test.mjs": { - node: { - allocatedMs: 60_000, - }, - }, - "./tests/**/*_browsers.test.mjs": { - node: { - allocatedMs: 90_000, + allocatedMs: ({ fileRelativeUrl }) => { + if (fileRelativeUrl.endsWith("coverage_browsers_and_node.test.mjs")) { + return 60_000; + } + if (fileRelativeUrl.endsWith("browser_tabs.test.mjs")) { + return 60_000; + } + if (fileRelativeUrl.endsWith("test_plan_logs_browsers.test.mjs")) { + return 160_000; + } + if (fileRelativeUrl.endsWith("_browsers.test.mjs")) { + return 90_000; + } + return 30_000; + }, }, }, }, diff --git a/packages/related/test/src/execution/execute_test_plan.js b/packages/related/test/src/execution/execute_test_plan.js index 25a7889667..6f78062357 100644 --- a/packages/related/test/src/execution/execute_test_plan.js +++ b/packages/related/test/src/execution/execute_test_plan.js @@ -747,7 +747,11 @@ To fix this warning: result: {}, }; if (typeof params.allocatedMs === "function") { - params.allocatedMs = params.allocatedMs(execution); + const allocatedMsResult = params.allocatedMs(execution); + params.allocatedMs = + allocatedMsResult === undefined + ? defaultMsAllocatedPerExecution + : allocatedMsResult; } lastExecution = execution; diff --git a/scripts/test/test.mjs b/scripts/test/test.mjs index 9dbdaaebac..e9b2d79012 100644 --- a/scripts/test/test.mjs +++ b/scripts/test/test.mjs @@ -17,15 +17,7 @@ await executeTestPlan({ testPlan: { "./tests/**/*.test.mjs": { node: { - runtime: nodeWorkerThread({ - env: { - NO_SNAPSHOT_ASSERTION: process.argv.includes( - "--no-snapshot-assertion", - ) - ? "1" - : "", - }, - }), + runtime: nodeWorkerThread(), allocatedMs: ({ fileRelativeUrl }) => { if (fileRelativeUrl.endsWith("_snapshots.test.mjs")) { return 180_000;