Allow overriding test timeout

This commit is contained in:
J8k3 2026-05-16 10:21:26 -04:00
parent 1aa54684d8
commit 5cc38496bd

View File

@ -82,7 +82,8 @@ export function logTestReport(testStatus, results) {
* Fail if the process takes longer than 60 seconds.
*/
export function setLongTestFailure() {
const timeLimit = 120;
const configuredTimeLimit = parseInt(process.env.CYBERCHEF_TEST_TIMEOUT_SECONDS || "", 10);
const timeLimit = Number.isFinite(configuredTimeLimit) && configuredTimeLimit > 0 ? configuredTimeLimit : 120;
setTimeout(function() {
console.log(`Tests took longer than ${timeLimit} seconds to run, returning.`);
process.exit(1);