Skip to content
Merged
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
16 changes: 14 additions & 2 deletions tests/e2e/project_template/test_static_crawlers_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
pytest.param('poetry', marks=pytest.mark.poetry),
],
)
@pytest.mark.flaky(
reruns=3,
reason='`apify push` occasionally hangs against the Apify platform; retries cover transient CLI/network flakes.',
)
async def test_static_crawler_actor_at_apify(
tmp_path: Path,
crawlee_wheel_path: Path,
Expand Down Expand Up @@ -80,14 +84,21 @@ async def test_static_crawler_actor_at_apify(
# Print apify version for debugging purposes in rare cases of CLI failures
subprocess.run(['apify', '--version'], check=True) # noqa: ASYNC221, S607

# Build actor using sequence of cli commands as the user would
# Build actor using sequence of cli commands as the user would.
subprocess.run( # noqa: ASYNC221, S603
['apify', 'login', '-t', os.environ['APIFY_TEST_USER_API_TOKEN']], # noqa: S607
capture_output=True,
check=True,
cwd=tmp_path / actor_name,
timeout=120,
)
subprocess.run( # noqa: ASYNC221, S603
['apify', 'init', '-y', actor_name], # noqa: S607
capture_output=True,
check=True,
cwd=tmp_path / actor_name,
timeout=120,
)
subprocess.run(['apify', 'init', '-y', actor_name], capture_output=True, check=True, cwd=tmp_path / actor_name) # noqa: ASYNC221, S603, S607

build_process = subprocess.run( # noqa: ASYNC221
['apify', 'push'], # noqa: S607
Expand All @@ -97,6 +108,7 @@ async def test_static_crawler_actor_at_apify(
# Prevent git from walking up into the surrounding project's .git/ when running under
# a basetemp inside the repo (see --basetemp in the e2e-templates-tests poe task).
env={**os.environ, 'GIT_CEILING_DIRECTORIES': str(tmp_path)},
timeout=120,
)
# Get actor ID from build log
actor_id_regexp = re.compile(r'https:\/\/console\.apify\.com\/actors\/(.*)#\/builds\/\d*\.\d*\.\d*')
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/browsers/test_browser_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def test_multiple_plugins_new_page_creation(server_url: URL) -> None:


@pytest.mark.flaky(
rerun=3,
reruns=3,
reason='Test is flaky on Windows and MacOS, see https://github.com/apify/crawlee-python/issues/1660.',
)
async def test_new_page_with_each_plugin(server_url: URL) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/browsers/test_stagehand_browser_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ async def test_proxy_set_browserbase(


@pytest.mark.flaky(
rerun=3,
reruns=3,
reason='Test is flaky on Windows when Playwright hits net::ERR_NO_BUFFER_SPACE under xdist load.',
)
async def test_fingerprint_headers_set_on_new_page(controller: StagehandBrowserController, server_url: URL) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ async def request_handler(context: AdaptivePlaywrightCrawlingContext) -> None:


@pytest.mark.flaky(
rerun=3,
reruns=3,
reason='Test is flaky on Windows when Playwright hits net::ERR_NO_BUFFER_SPACE and retries, '
'causing the pre-nav hook to fire one extra time.',
)
Expand Down Expand Up @@ -637,7 +637,7 @@ async def request_handler(context: AdaptivePlaywrightCrawlingContext) -> None:


@pytest.mark.flaky(
rerun=3,
reruns=3,
reason='Test is flaky on Windows and MacOS, see https://github.com/apify/crawlee-python/issues/1650.',
)
async def test_adaptive_context_query_selector_beautiful_soup(test_urls: list[str]) -> None:
Expand Down Expand Up @@ -683,7 +683,7 @@ async def request_handler(context: AdaptivePlaywrightCrawlingContext) -> None:


@pytest.mark.flaky(
rerun=3,
reruns=3,
reason='Test is flaky on Windows and MacOS, see https://github.com/apify/crawlee-python/issues/1650.',
)
async def test_adaptive_context_query_selector_parsel(test_urls: list[str]) -> None:
Expand Down
Loading