From 0a81500d987d641442c4dac04d072b334375b06c Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Thu, 16 Apr 2026 14:23:50 +0200 Subject: [PATCH 1/2] test: extend retry window for synthetic PPE event propagation Synthetic events like `apify-default-dataset-item` are computed by the platform from dataset writes asynchronously, so they propagate more slowly than explicit charges. Increase retry_counter from 30 to 120 (2 minutes). Co-Authored-By: Claude Sonnet 4.6 --- tests/e2e/test_actor_charge.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/e2e/test_actor_charge.py b/tests/e2e/test_actor_charge.py index 0e2e98a0..82728ce0 100644 --- a/tests/e2e/test_actor_charge.py +++ b/tests/e2e/test_actor_charge.py @@ -171,8 +171,11 @@ async def test_actor_push_data_charges_both_events( """Test that push_data charges both the explicit event and the synthetic apify-default-dataset-item event.""" run = await run_actor(ppe_push_data_actor) - # Refetch until the platform gets its act together - for is_last_attempt, _ in retry_counter(30): + # Refetch until the platform gets its act together. + # Use a longer retry window (120 attempts x 1 s) for synthetic events like `apify-default-dataset-item`: + # the platform computes them from dataset writes asynchronously, so they propagate more slowly than + # explicit charges (which are reflected immediately via the charge endpoint). + for is_last_attempt, _ in retry_counter(120): await asyncio.sleep(1) updated_run = await apify_client_async.run(run.id).get() run = ActorRun.model_validate(updated_run) @@ -200,8 +203,11 @@ async def test_actor_push_data_combined_budget_limit( """ run = await run_actor(ppe_push_data_actor, max_total_charge_usd=Decimal('0.20')) - # Refetch until the platform gets its act together - for is_last_attempt, _ in retry_counter(30): + # Refetch until the platform gets its act together. + # Use a longer retry window (120 attempts x 1 s) for synthetic events like `apify-default-dataset-item`: + # the platform computes them from dataset writes asynchronously, so they propagate more slowly than + # explicit charges (which are reflected immediately via the charge endpoint). + for is_last_attempt, _ in retry_counter(120): await asyncio.sleep(1) updated_run = await apify_client_async.run(run.id).get() run = ActorRun.model_validate(updated_run) From 21c6515e0adb6cf733e81ae92e6497dfda330221 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Thu, 16 Apr 2026 15:20:51 +0200 Subject: [PATCH 2/2] chore: remove redundant comment per review feedback Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/e2e/test_actor_charge.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/e2e/test_actor_charge.py b/tests/e2e/test_actor_charge.py index 82728ce0..f8b1f393 100644 --- a/tests/e2e/test_actor_charge.py +++ b/tests/e2e/test_actor_charge.py @@ -171,7 +171,6 @@ async def test_actor_push_data_charges_both_events( """Test that push_data charges both the explicit event and the synthetic apify-default-dataset-item event.""" run = await run_actor(ppe_push_data_actor) - # Refetch until the platform gets its act together. # Use a longer retry window (120 attempts x 1 s) for synthetic events like `apify-default-dataset-item`: # the platform computes them from dataset writes asynchronously, so they propagate more slowly than # explicit charges (which are reflected immediately via the charge endpoint). @@ -203,7 +202,6 @@ async def test_actor_push_data_combined_budget_limit( """ run = await run_actor(ppe_push_data_actor, max_total_charge_usd=Decimal('0.20')) - # Refetch until the platform gets its act together. # Use a longer retry window (120 attempts x 1 s) for synthetic events like `apify-default-dataset-item`: # the platform computes them from dataset writes asynchronously, so they propagate more slowly than # explicit charges (which are reflected immediately via the charge endpoint).