Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
chore(e2e): fix flaky e2e test orchestration (#3255)
Jindřich Bär59f2074dc9b5
diff --git a/test/e2e/run.mjs b/test/e2e/run.mjsindex ae3784d36..1fbc005e8 100644--- a/test/e2e/run.mjs+++ b/test/e2e/run.mjs@@ -141,15 +141,17 @@ async function run() {if (status === 'failure') failure = true;};+ const { promise: waitForExit, resolve: markTestDone } = Promise.withResolvers();+worker.on('exit', async (exitCode) => {try {await exitHandler(exitCode);} finally {- worker.emit('done');+ markTestDone();}});- await once(worker, 'done');+ await waitForExit;}}@@ -157,19 +159,31 @@ if (isMainThread) {try {if (process.env.STORAGE_IMPLEMENTATION === 'LOCAL') {console.log('Temporary installing @apify/storage-local');- execSync(`yarn add -D @apify/storage-local@^2.1.3-beta.1 > /dev/null`, { stdio: 'inherit' });+ execSync(`yarn add -D "@apify/storage-local@^2.3.1-beta.1"`, { stdio: 'inherit' });}if (process.env.STORAGE_IMPLEMENTATION !== 'PLATFORM') {- console.log('Fetching camoufox');- execSync(`npx camoufox-js fetch > /dev/null`, { stdio: 'inherit' });+ console.log('Fetching Camoufox...');++ for (let attempt = 0; attempt < 5; attempt++) {+ try {+ execSync(`npx camoufox-js fetch`, { stdio: 'inherit' });+ } catch (e) {+ console.error('Failed to fetch Camoufox', e);+ if (attempt === 4) throw e;+ console.log(`Retrying to fetch Camoufox (attempt ${attempt + 2}/5)...`);+ await new Promise((resolve) => setTimeout(resolve, 10e3));+ continue;+ }+ }}await run();} catch (e) {+ failure = true;console.error(e);} finally {if (process.env.STORAGE_IMPLEMENTATION === 'LOCAL') {console.log('Removing temporary installation of @apify/storage-local');- execSync(`yarn remove @apify/storage-local > /dev/null`, { stdio: 'inherit' });+ execSync(`yarn remove @apify/storage-local`, { stdio: 'inherit' });}}