Skip to content
Closed
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
8 changes: 8 additions & 0 deletions tests/e2e/test_actor_api_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ def do_POST(self) -> None:
await Actor.set_value('WEBHOOK_BODY', webhook_body)

async def main_client() -> None:
import asyncio

from apify import Webhook, WebhookEventType

async with Actor:
Expand All @@ -438,6 +440,12 @@ async def main_client() -> None:
)
)

# Keep the run alive for a moment after registering the webhook. Without this, the run finishes
# just milliseconds later and the platform may process the run-succeeded event before the freshly
# added ad-hoc webhook has propagated, in which case the webhook never fires and the server Actor
# waits until it times out.
await asyncio.sleep(5)

server_actor, client_actor = await asyncio.gather(
make_actor(label='add-webhook-server', main_func=main_server),
make_actor(label='add-webhook-client', main_func=main_client),
Expand Down
Loading