Commit e18d395
test: Fix flaky tests in adaptive crawler and sitemap loader (#1847)
## Summary
- Add `@pytest.mark.flaky(rerun=3)` to
`test_adaptive_context_query_selector_beautiful_soup` — the parsel
variant already had this marker for the same timing issue (#1650), but
the BeautifulSoup variant was missing it. The test relies on Playwright
detecting a JS-injected `<h2>` within a 200ms window, which is racy on
macOS/Windows CI.
- Increase `asyncio.wait_for` timeout from 2s to 10s in
`test_data_persistence_for_sitemap_loading` — on Windows CI with httpx,
the HTTP client hit a connection error and started retrying, exhausting
the 2-second window. The test validates data persistence, not latency.
Failed CI jobs:
- [Unit tests (macos-latest,
3.14)](https://github.com/apify/crawlee-python/actions/runs/24454238446/job/71450602394)
- [Unit tests (windows-latest,
3.12)](https://github.com/apify/crawlee-python/actions/runs/24454238446/job/71450602420)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent f241ead commit e18d395
File tree
2 files changed
+5
-1
lines changed- tests/unit
- crawlers/_adaptive_playwright
- request_loaders
2 files changed
+5
-1
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
634 | 638 | | |
635 | 639 | | |
636 | 640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
0 commit comments