harness: allow overriding the test timeout via env variable
This commit is contained in:
parent
ee47aa4837
commit
cf49af2bb9
@ -338,8 +338,17 @@ export async function runTests(spec: TestRunSpec) {
|
|||||||
currentChild.stdout?.pipe(harnessLogStream);
|
currentChild.stdout?.pipe(harnessLogStream);
|
||||||
currentChild.stderr?.pipe(harnessLogStream);
|
currentChild.stderr?.pipe(harnessLogStream);
|
||||||
|
|
||||||
const defaultTimeout = 60000;
|
// Default timeout when the test doesn't override it.
|
||||||
const testTimeoutMs = testCase.timeoutMs ?? defaultTimeout;
|
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) {
|
if (spec.noTimeout) {
|
||||||
console.log(`running ${testName}, no timeout`);
|
console.log(`running ${testName}, no timeout`);
|
||||||
|
Loading…
Reference in New Issue
Block a user