test: fix flaky Windows CI failures in statistics and browser-pool tests#1947
Open
vdusek wants to merge 1 commit into
Open
test: fix flaky Windows CI failures in statistics and browser-pool tests#1947vdusek wants to merge 1 commit into
vdusek wants to merge 1 commit into
Conversation
Give the statistics poll a generous timeout so crawler startup can reach the active state on slow CI, and run the resource-heavy Firefox launch test in isolation so it stops timing out under xdist contention.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1947 +/- ##
==========================================
+ Coverage 92.98% 93.02% +0.04%
==========================================
Files 167 167
Lines 11712 11712
==========================================
+ Hits 10890 10895 +5
+ Misses 822 817 -5
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:
|
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.
Two unit tests flaked on a master push build (run,
windows-latest, Python 3.10).test_crawler_intermediate_statistics—poll_until_condition(lambda: crawler.statistics.active)used the helper's default 5s ceiling. Under xdist load on a slow Windows runner, crawler startup didn't reach the active state in time, so the poll returnedFalse. Pass a generoustimeout=30(the happy path still returns in <1s, so there's no cost on green runs).test_with_default_plugin_constructor— launching a real Firefox browser timed out even withoperation_timeout=60swhile competing with other xdist workers on the constrained Windows runner. The existing@run_alone_on_maconly isolated macOS, so Windows still ran it in the parallel pool. Upgraded to@pytest.mark.run_aloneso the heavy browser launch gets the full machine on every platform; the 60s timeout is kept.Both flakes are Windows-resource-specific, so local Linux re-runs (10/10 and 5/5 green) confirm the fixes are valid but can't reproduce the original failure mode — CI re-verifies the Windows path.