test: mark test_get_snapshot with run_alone to deflake CI - #2150
Open
vdusek wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2150 +/- ##
==========================================
+ Coverage 93.55% 93.57% +0.01%
==========================================
Files 181 181
Lines 12648 12648
==========================================
+ Hits 11833 11835 +2
+ Misses 815 813 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vdusek
marked this pull request as ready for review
August 11, 2026 07:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_get_snapshotfailed onmacos-latest/ Python 3.10 in run 31388378733 onassert snapshot.screenshot is not None, with Chromium answeringProtocol error (Page.captureScreenshot): Unable to capture screenshot.The macOS image is the smallest of the three (~3 vCPU / 7 GB), yet the
-m "not run_alone"pass drives 8 xdist workers. At the failure timestamp three of them were each running their own Chromium:gw7intest_get_snapshot,gw0cycling thetest_chromium_headless_headersparametrizations, andgw4in the stagehand browser-controller tests. Under that contention the renderer cannot composite a frame for afull_pagecapture, and Playwright does not retry the error.PlaywrightPreNavCrawlingContext.get_snapshot()deliberately degrades that failure toscreenshot=None- an error snapshot must never break a crawl, andErrorSnapshotteralready guards on it - so the test observesNone. The nondeterminism is runner contention, not a race in Crawlee, so product code is unchanged.@pytest.mark.run_alonemoves the test into the serial--numprocesses=1pass, removing the contention while keeping every assertion intact. This is the second tier of the hierarchy documented intests/unit/README.md; the same file already markstest_firefox_headless_headersandtest_isolation_cookiesthis way.The failure does not reproduce on Linux - 0/20 runs of the Playwright module at
-n 16(oversubscribing 8 cores) - so macOS CI is what re-verifies the fix. Locally the marker routes the test correctly (53 collected in the parallel pass, 4 in the serial one) and the fullrun_alonegroup is green at 14 items.✍️ Drafted by Claude Code