Merge pull request #4437 from matrix-org/travis/test-logs

Don't explode if the e2e test directory exists when crashing
pull/21833/head
Travis Ralston 2020-04-17 14:52:12 -06:00 committed by GitHub
commit a234cb8a44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -93,7 +93,13 @@ async function writeLogs(sessions, dir) {
for (let i = 0; i < sessions.length; ++i) { for (let i = 0; i < sessions.length; ++i) {
const session = sessions[i]; const session = sessions[i];
const userLogDir = `${dir}/${session.username}`; 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 consoleLogName = `${userLogDir}/console.log`;
const networkLogName = `${userLogDir}/network.log`; const networkLogName = `${userLogDir}/network.log`;
const appHtmlName = `${userLogDir}/app.html`; const appHtmlName = `${userLogDir}/app.html`;