Skip to content

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.

Fix flaky test

Ondra Urbanfcd599eed4ad
diff --git a/test/puppeteer_pool.js b/test/puppeteer_pool.js
index e75f093b4..86b7728cd 100644
--- a/test/puppeteer_pool.js
+++ b/test/puppeteer_pool.js
@@ -550,7 +550,7 @@ describe('PuppeteerPool', () => {
beforeEach(() => {
log.setLevel(log.LEVELS.OFF);
pool = new Apify.PuppeteerPool({
- puppeteerOperationTimeoutSecs: 0.05,
+ puppeteerOperationTimeoutSecs: 0.005,
launchPuppeteerOptions: {
headless: true,
},
@@ -563,7 +563,7 @@ describe('PuppeteerPool', () => {
it('should work', async () => {
try {
- await pool._openNewTab(0); // eslint-disable-line no-underscore-dangle
+ await pool._openNewTab(); // eslint-disable-line no-underscore-dangle
throw new Error('invalid error');
} catch (err) {
expect(err.stack).to.include('timed out');