Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/unit/browsers/test_browser_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from crawlee.browsers import BrowserPool, PlaywrightBrowserPlugin
from crawlee.browsers._browser_controller import BrowserController
from crawlee.browsers._types import CrawleePage
from tests.unit.utils import run_alone_on_mac

if TYPE_CHECKING:
from collections.abc import Mapping
Expand Down Expand Up @@ -103,9 +102,11 @@ async def test_new_page_with_each_plugin(server_url: URL) -> None:
assert browser_pool.total_pages_count == 2


@run_alone_on_mac
@pytest.mark.run_alone
async def test_with_default_plugin_constructor(server_url: URL) -> None:
# Use a generous operation timeout so that Firefox has enough time to launch on slow Windows CI.
# Launching a real Firefox browser is resource-heavy and flakes under xdist parallelism (it can time out
# even with a generous operation timeout when several workers compete for the runner). Run it alone and
# keep a generous operation timeout so that Firefox has enough time to launch on slow CI.
async with BrowserPool.with_default_plugin(
headless=True, browser_type='firefox', operation_timeout=timedelta(seconds=60)
) as browser_pool:
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/crawlers/_basic/test_basic_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1993,9 +1993,10 @@ async def test_crawler_intermediate_statistics() -> None:
async def handler(_: BasicCrawlingContext) -> None:
await asyncio.sleep(check_time.total_seconds() * 5)

# Start crawler and wait until statistics are initialized.
# Start crawler and wait until statistics are initialized. Use a generous timeout so that crawler startup
# has enough time to reach the active state on slow CI runners under xdist load.
crawler_task = asyncio.create_task(crawler.run(['https://a.placeholder.com']))
assert await poll_until_condition(lambda: crawler.statistics.active)
assert await poll_until_condition(lambda: crawler.statistics.active, timeout=30)

# Wait some time and check that runtime is updated.
await asyncio.sleep(check_time.total_seconds())
Expand Down
Loading