From 88b5c3ca840799fce2ec92fc6cdbc7e400a85516 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 17 Apr 2020 14:39:45 -0600 Subject: [PATCH] Don't explode if the e2e test directory exists when crashing This is largely expected in local test environments where the developer probably won't remember to clear out the directory themselves. --- test/end-to-end-tests/start.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/end-to-end-tests/start.js b/test/end-to-end-tests/start.js index 83bc186356..6c80608903 100644 --- a/test/end-to-end-tests/start.js +++ b/test/end-to-end-tests/start.js @@ -93,7 +93,13 @@ async function writeLogs(sessions, dir) { for (let i = 0; i < sessions.length; ++i) { const session = sessions[i]; const userLogDir = `${dir}/${session.username}`; - fs.mkdirSync(userLogDir); + try { + fs.mkdirSync(userLogDir); + } catch (e) { + // typically this will be EEXIST. If it's something worse, the next few + // lines will fail too. + console.warn(`non-fatal error creating ${userLogDir} :`, e.message); + } const consoleLogName = `${userLogDir}/console.log`; const networkLogName = `${userLogDir}/network.log`; const appHtmlName = `${userLogDir}/app.html`;