test: mark test_adaptive_crawling_pre_nav_change_to_context as flaky#1876
Merged
test: mark test_adaptive_crawling_pre_nav_change_to_context as flaky#1876
Conversation
On Windows CI, Playwright occasionally hits net::ERR_NO_BUFFER_SPACE during Page.goto, causing a request retry that fires the pre-nav hook one extra time. The test's intent (no user_data leakage between probes) still holds, but the hard-coded count of 2 invocations breaks. Match the existing pattern used elsewhere in the file for similar Windows-only network flakiness.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1876 +/- ##
==========================================
- Coverage 92.57% 92.51% -0.06%
==========================================
Files 158 158
Lines 11078 11078
==========================================
- Hits 10255 10249 -6
- Misses 823 829 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
On Windows CI, the test
test_adaptive_crawling_pre_nav_change_to_contextoccasionally fails because Playwright'sPage.gotohitsnet::ERR_NO_BUFFER_SPACE(transient socket buffer exhaustion under concurrent test load). The retry causes the pre-navigation hook to fire 3 times instead of 2 (static probe, failed Playwright probe, Playwright retry), tripping the hard-codedassert user_data_in_pre_nav_hook == [None, None].The test's actual property under test — that probes don't leak
user_databetween invocations — still holds (every captured value isNone); only the count is fragile.This adds
@pytest.mark.flaky(rerun=3), matching the existing pattern at lines 633 and 679 of the same file (which use the same marker for the same kind of Windows-only network flakiness).Failing job: https://github.com/apify/crawlee-python/actions/runs/25424362761/job/74573949683?pr=1762