Commit f9ade32
authored
test: fix flaky Windows CI failures in statistics and browser-pool tests (#1947)
Two unit tests flaked on a master push build
([run](https://github.com/apify/crawlee-python/actions/runs/26953000755/job/79522749183),
`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
returned `False`. Pass a generous `timeout=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 with `operation_timeout=60s` while competing with
other xdist workers on the constrained Windows runner. The existing
`@run_alone_on_mac` only isolated macOS, so Windows still ran it in the
parallel pool. Upgraded to `@pytest.mark.run_alone` so 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.1 parent f0c4550 commit f9ade32
2 files changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
106 | | - | |
| 105 | + | |
107 | 106 | | |
108 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1993 | 1993 | | |
1994 | 1994 | | |
1995 | 1995 | | |
1996 | | - | |
| 1996 | + | |
| 1997 | + | |
1997 | 1998 | | |
1998 | | - | |
| 1999 | + | |
1999 | 2000 | | |
2000 | 2001 | | |
2001 | 2002 | | |
| |||
0 commit comments