diff --git a/tests/e2e/test_actor_charge.py b/tests/e2e/test_actor_charge.py index 0e2e98a0..f8b1f393 100644 --- a/tests/e2e/test_actor_charge.py +++ b/tests/e2e/test_actor_charge.py @@ -171,8 +171,10 @@ 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): + # 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 +202,10 @@ 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): + # 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)