diff --git a/pyproject.toml b/pyproject.toml index d17bdc01..7141802c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,6 +78,7 @@ dev = [ "pytest-asyncio<2.0.0", "pytest-cov<8.0.0", "pytest-httpserver<2.0.0", + "pytest-rerunfailures<17.0.0", "pytest-timeout<3.0.0", "pytest-xdist<4.0.0", "pytest<10.0.0", diff --git a/tests/e2e/test_actor_api_helpers.py b/tests/e2e/test_actor_api_helpers.py index 3747dd3b..0be7c2b8 100644 --- a/tests/e2e/test_actor_api_helpers.py +++ b/tests/e2e/test_actor_api_helpers.py @@ -4,6 +4,8 @@ import json from typing import TYPE_CHECKING +import pytest + from apify_shared.consts import ActorPermissionLevel from crawlee._utils.crypto import crypto_random_object_id @@ -387,6 +389,9 @@ async def main() -> None: assert reboot_counter['value'] == 2 +# Flaky: the server Actor blocks until the platform delivers the client's `ACTOR_RUN_SUCCEEDED` webhook; when +# delivery is delayed past the run timeout, the run ends as `TIMED-OUT`. Platform-side, outside our control, so retry. +@pytest.mark.flaky(reruns=3) async def test_actor_adds_webhook_and_receives_event( make_actor: MakeActorFunction, run_actor: RunActorFunction, diff --git a/uv.lock b/uv.lock index e1354c0b..fe11ef14 100644 --- a/uv.lock +++ b/uv.lock @@ -72,6 +72,7 @@ dev = [ { name = "pytest-asyncio" }, { name = "pytest-cov" }, { name = "pytest-httpserver" }, + { name = "pytest-rerunfailures" }, { name = "pytest-timeout" }, { name = "pytest-xdist" }, { name = "ruff" }, @@ -114,6 +115,7 @@ dev = [ { name = "pytest-asyncio", specifier = "<2.0.0" }, { name = "pytest-cov", specifier = "<8.0.0" }, { name = "pytest-httpserver", specifier = "<2.0.0" }, + { name = "pytest-rerunfailures", specifier = "<17.0.0" }, { name = "pytest-timeout", specifier = "<3.0.0" }, { name = "pytest-xdist", specifier = "<4.0.0" }, { name = "ruff", specifier = "~=0.15.0" }, @@ -1927,6 +1929,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ec/df/0bdf90b84c6a586a9fd2b509523a3ab26b1cc1b1dba2fb62a32e4411ea9e/pytest_httpserver-1.1.5-py3-none-any.whl", hash = "sha256:ee83feb587ab652c0c6729598db2820e9048233bac8df756818b7845a1621d0a", size = 23330, upload-time = "2026-02-14T13:27:22.119Z" }, ] +[[package]] +name = "pytest-rerunfailures" +version = "15.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "packaging" }, + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a0/78/e6e358545537a8e82c4dc91e72ec0d6f80546a3786dd27c76b06ca09db77/pytest_rerunfailures-15.1.tar.gz", hash = "sha256:c6040368abd7b8138c5b67288be17d6e5611b7368755ce0465dda0362c8ece80", size = 26981, upload-time = "2025-05-08T06:36:33.483Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f3/30/11d836ff01c938969efa319b4ebe2374ed79d28043a12bfc908577aab9f3/pytest_rerunfailures-15.1-py3-none-any.whl", hash = "sha256:f674c3594845aba8b23c78e99b1ff8068556cc6a8b277f728071fdc4f4b0b355", size = 13274, upload-time = "2025-05-08T06:36:32.029Z" }, +] + [[package]] name = "pytest-timeout" version = "2.4.0"