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 unstable test

Ondra Urbana8caed48dfe5
diff --git a/test/autoscaling/snapshotter.js b/test/autoscaling/snapshotter.js
index 4d2079647..f14a3d31e 100644
--- a/test/autoscaling/snapshotter.js
+++ b/test/autoscaling/snapshotter.js
@@ -130,7 +130,7 @@ describe('Snapshotter', () => {
const prev = eventLoopSnapshots[idx - 1].createdAt;
const curr = ss.createdAt;
const next = eventLoopSnapshots[idx + 1].createdAt;
- expect(curr - prev).to.be.above(DELAY - 1);
+ expect(curr - prev).to.be.above(snapshotter.maxBlockedMillis);
expect(next - curr).to.be.within(TICK - 1, TICK + snapshotter.maxBlockedMillis);
expect(ss.exceededMillis).to.be.within(1, DELAY - snapshotter.maxBlockedMillis);
} else {