try to deflake tests

pull/8373/head
Simon Holthausen 4 years ago
parent 5638aadf6a
commit 1be3f9cbb4

@ -57,8 +57,6 @@ async function launchPuppeteer() {
const assert = fs.readFileSync(`${__dirname}/assert.js`, 'utf-8'); const assert = fs.readFileSync(`${__dirname}/assert.js`, 'utf-8');
describe('runtime (puppeteer)', function() { describe('runtime (puppeteer)', function() {
// Note: Increase the timeout in preparation for restarting Chromium due to SIGSEGV.
this.timeout(10000);
before(async () => { before(async () => {
svelte = loadSvelte(false); svelte = loadSvelte(false);
console.log('[runtime-puppeteer] Loaded Svelte'); console.log('[runtime-puppeteer] Loaded Svelte');
@ -75,7 +73,7 @@ describe('runtime (puppeteer)', function() {
const failed = new Set(); const failed = new Set();
function runTest(dir, hydrate) { function runTest(dir, hydrate, is_first_run) {
if (dir[0] === '.') return; if (dir[0] === '.') return;
// MEMO: puppeteer can not execute Chromium properly with Node8,10 on Linux at GitHub actions. // MEMO: puppeteer can not execute Chromium properly with Node8,10 on Linux at GitHub actions.
const { version } = process; const { version } = process;
@ -254,11 +252,14 @@ describe('runtime (puppeteer)', function() {
prettyPrintPuppeteerAssertionError(err.message); prettyPrintPuppeteerAssertionError(err.message);
assertWarnings(); assertWarnings();
}); });
}); }).timeout(is_first_run ? 20000 : 10000);
} }
// Increase the timeout on the first run in preparation for restarting Chromium due to SIGSEGV.
let first_run = true;
fs.readdirSync(`${__dirname}/samples`).forEach(dir => { fs.readdirSync(`${__dirname}/samples`).forEach(dir => {
runTest(dir, false); runTest(dir, false, first_run);
runTest(dir, true); runTest(dir, true, first_run);
first_run = false;
}); });
}); });

Loading…
Cancel
Save