Skip to content

test: fix flaky test test_isolation_cookies for playwright crawler#1729

Merged
vdusek merged 4 commits intoapify:masterfrom
Mantisus:flaky-playwright-cookies
May 5, 2026
Merged

test: fix flaky test test_isolation_cookies for playwright crawler#1729
vdusek merged 4 commits intoapify:masterfrom
Mantisus:flaky-playwright-cookies

Conversation

@Mantisus
Copy link
Copy Markdown
Collaborator

@Mantisus Mantisus commented Feb 10, 2026

Summary

Hypothesis for the root cause: if Playwright runs slowly, the browser may be moved to the inactive list by BrowserPool._identify_inactive_browsers() between requests. When a new context is opened, the assertion breaks, and the test fails.

The fix increases the time interval during which the browser stays active.

Closes: #1651

@Mantisus Mantisus force-pushed the flaky-playwright-cookies branch 5 times, most recently from 0a889e3 to 2c42bc1 Compare February 10, 2026 18:29
@vdusek vdusek changed the title chore: fix flaky test test_playwright_crawler.py::test_isolation_cookies[without use_incognito_pages] test: fix flaky test test_playwright_crawler.py::test_isolation_cookies[without use_incognito_pages] Feb 10, 2026
@vdusek vdusek changed the title test: fix flaky test test_playwright_crawler.py::test_isolation_cookies[without use_incognito_pages] test: fix flaky test test_isolation_cookies for playwright crawler Feb 10, 2026
@Mantisus Mantisus force-pushed the flaky-playwright-cookies branch 22 times, most recently from eebd6a1 to cd4ade1 Compare February 11, 2026 14:27
@Mantisus Mantisus force-pushed the flaky-playwright-cookies branch 8 times, most recently from 8a9407c to 46700e3 Compare February 11, 2026 17:38
@Mantisus Mantisus force-pushed the flaky-playwright-cookies branch from 46700e3 to 9ddb787 Compare February 11, 2026 17:59
@Mantisus Mantisus marked this pull request as ready for review May 4, 2026 20:35
@Mantisus Mantisus requested a review from vdusek May 4, 2026 20:35
@Mantisus Mantisus self-assigned this May 4, 2026
Copy link
Copy Markdown
Collaborator

@vdusek vdusek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's see 🙂

@vdusek vdusek merged commit 6b91edc into apify:master May 5, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test test_isolation_cookies is flaky

3 participants