Skip to content

test: mark test_adaptive_crawling_pre_nav_change_to_context as flaky#1876

Merged
vdusek merged 1 commit intomasterfrom
test/flaky-adaptive-pre-nav-hook
May 6, 2026
Merged

test: mark test_adaptive_crawling_pre_nav_change_to_context as flaky#1876
vdusek merged 1 commit intomasterfrom
test/flaky-adaptive-pre-nav-hook

Conversation

@vdusek
Copy link
Copy Markdown
Collaborator

@vdusek vdusek commented May 6, 2026

Summary

On Windows CI, the test test_adaptive_crawling_pre_nav_change_to_context occasionally fails because Playwright's Page.goto hits net::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-coded assert user_data_in_pre_nav_hook == [None, None].

The test's actual property under test — that probes don't leak user_data between invocations — still holds (every captured value is None); 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

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.
@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels May 6, 2026
@vdusek vdusek self-assigned this May 6, 2026
@github-actions github-actions Bot added this to the 140th sprint - Tooling team milestone May 6, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label May 6, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.51%. Comparing base (65bf68d) to head (182280f).
⚠️ Report is 1 commits behind head on master.

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     
Flag Coverage Δ
unit 92.51% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek merged commit ab12bae into master May 6, 2026
32 checks passed
@vdusek vdusek deleted the test/flaky-adaptive-pre-nav-hook branch May 6, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants