From a26e25153373b7e99f55d4a38686f634ea2b80ec Mon Sep 17 00:00:00 2001 From: "jj@jjsweb.site" Date: Wed, 27 Oct 2021 11:26:36 -0500 Subject: [PATCH] Update test traces to only run on retry --- run-tests.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/run-tests.js b/run-tests.js index fa12461f17a6e..f29744997bba9 100644 --- a/run-tests.js +++ b/run-tests.js @@ -228,7 +228,7 @@ async function main() { ) const children = new Set() - const runTest = (test = '', usePolling, isFinalRun) => + const runTest = (test = '', isFinalRun) => new Promise((resolve, reject) => { const start = new Date().getTime() let outputChunks = [] @@ -250,16 +250,18 @@ async function main() { ...process.env, // run tests in headless mode by default HEADLESS: 'true', - TRACE_PLAYWRIGHT: 'true', - // ...(usePolling - // ? { - // // Events can be finicky in CI. This switches to a more - // // reliable polling method. - // CHOKIDAR_USEPOLLING: 'true', - // CHOKIDAR_INTERVAL: 500, - // WATCHPACK_POLLING: 500, - // } - // : {}), + ...(isFinalRun + ? { + // only trace on final run as previous traces + // are removed anyways + TRACE_PLAYWRIGHT: 'true', + // Events can be finicky in CI. This switches to a more + // reliable polling method. + // CHOKIDAR_USEPOLLING: 'true', + // CHOKIDAR_INTERVAL: 500, + // WATCHPACK_POLLING: 500, + } + : {}), }, } ) @@ -330,7 +332,7 @@ async function main() { for (let i = 0; i < numRetries + 1; i++) { try { console.log(`Starting ${test} retry ${i}/${numRetries}`) - const time = await runTest(test, i > 0, i === numRetries) + const time = await runTest(test, i === numRetries) timings.push({ file: test, time,