From e75789f0417f0932dc5b89a0cea69e8db2c05af9 Mon Sep 17 00:00:00 2001 From: Enoch Riese Date: Tue, 15 Nov 2022 10:29:13 -0600 Subject: [PATCH] increase test timeout --- scripts/testall.js | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/scripts/testall.js b/scripts/testall.js index 4344ee97eff..9d798b015df 100644 --- a/scripts/testall.js +++ b/scripts/testall.js @@ -1,25 +1,40 @@ const fs = require('fs') -const path = require('path'); +const path = require('path') const spawn = require('child_process').spawn -const projectRoot = path.normalize(path.join(__dirname, '..')); -const outputLog = path.join(projectRoot, '.test-failures.log'); -const collectorScript = path.join(projectRoot, 'scripts', 'test-failure-collector.js'); +const projectRoot = path.normalize(path.join(__dirname, '..')) +const outputLog = path.join(projectRoot, '.test-failures.log') +const collectorScript = path.join(projectRoot, 'scripts', 'test-failure-collector.js') // Start with a fresh output log on each run. if (fs.existsSync(outputLog)) { - fs.unlinkSync(outputLog); + fs.unlinkSync(outputLog) } // Run all tests, specifying the collector script. -spawn('lerna', ['run', '--no-bail', 'testci', '--stream', '--parallel', '--loglevel', 'error', '--', '--file', `${collectorScript}`, '--no-warnings'], { stdio: 'inherit' }) - .on('exit', function(code) { - // If a failure occurred, the log file will have been created. Print it. - if (fs.existsSync(outputLog)) { - console.error(fs.readFileSync(outputLog, 'utf8').trim()); - } - - // Propagate the exit code. - process.exit(code); - }); +spawn( + 'lerna', + [ + 'run', + '--no-bail', + 'testci', + '--stream', + '--parallel', + '--loglevel', + 'error', + '--', + '--file', + `${collectorScript}`, + '--no-warnings', + '--timeout=5000', + ], + { stdio: 'inherit' } +).on('exit', function (code) { + // If a failure occurred, the log file will have been created. Print it. + if (fs.existsSync(outputLog)) { + console.error(fs.readFileSync(outputLog, 'utf8').trim()) + } + // Propagate the exit code. + process.exit(code) +})