aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-08-03 21:44:43 +0200
committerFlorian Dold <florian@dold.me>2023-08-03 21:44:43 +0200
commitcf49af2bb9fcc2ceae15a7b90045cc79914dc453 (patch)
treec1e2eac69cd40db514c2e59a247e2c13c38c1133 /packages/taler-harness
parentee47aa4837fedcaa8257b57138ea34fda220d2b7 (diff)
downloadwallet-core-cf49af2bb9fcc2ceae15a7b90045cc79914dc453.tar.xz
harness: allow overriding the test timeout via env variable
Diffstat (limited to 'packages/taler-harness')
-rw-r--r--packages/taler-harness/src/integrationtests/testrunner.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/taler-harness/src/integrationtests/testrunner.ts b/packages/taler-harness/src/integrationtests/testrunner.ts
index e35264d13..67572f0f7 100644
--- a/packages/taler-harness/src/integrationtests/testrunner.ts
+++ b/packages/taler-harness/src/integrationtests/testrunner.ts
@@ -338,8 +338,17 @@ export async function runTests(spec: TestRunSpec) {
currentChild.stdout?.pipe(harnessLogStream);
currentChild.stderr?.pipe(harnessLogStream);
- const defaultTimeout = 60000;
- const testTimeoutMs = testCase.timeoutMs ?? defaultTimeout;
+ // Default timeout when the test doesn't override it.
+ let defaultTimeout = 60000;
+ const overrideDefaultTimeout = process.env.TALER_TEST_TIMEOUT;
+ if (overrideDefaultTimeout) {
+ defaultTimeout = Number.parseInt(overrideDefaultTimeout, 10) * 1000;
+ }
+
+ // Set the timeout to at least be the default timeout.
+ const testTimeoutMs = testCase.timeoutMs
+ ? Math.max(testCase.timeoutMs, defaultTimeout)
+ : defaultTimeout;
if (spec.noTimeout) {
console.log(`running ${testName}, no timeout`);