test: Give Apify builds more time in scheduled e2e templates test#1909
Merged
Conversation
…for_finish cap `actor.build(wait_for_finish=600)` is silently clipped to the API's 60s maximum, so the stagehand rebuild (playwright + browser deps) returned before completion and `actor.start(build=...)` rejected the run with "The build has not finished or was not successful." Poll on the build client and assert SUCCEEDED before starting.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1909 +/- ##
==========================================
- Coverage 92.89% 92.85% -0.05%
==========================================
Files 167 167
Lines 11714 11714
==========================================
- Hits 10882 10877 -5
- Misses 832 837 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
`apify push` waits server-side for the actor's Docker build to complete before returning, and the heavier templates (e.g. adaptive-parsel with a ~550 MB base image) consistently exceed the previous 120s budget — all 4 rerun attempts hit the timeout, so retries don't help. Bump every apify-cli subprocess timeout to 600s; the 1800s pytest-timeout still bounds a truly hung CLI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related scheduled e2e failures, both fixed by giving Apify builds more time to complete.
1. Stagehand rebuild:
wait_for_finish=600was silently clipped to 60sThe scheduled stagehand tests have been failing on every run since #1900 added the post-
env_vars.createrebuild (example):ActorClientAsync.build()'swait_for_finishparameter is clipped server-side to a max of 60s ("By default it is 0, the maximum value is 60"). A stagehand build (playwright + browser deps) does not finish in 60s, soactor.build()returned a still-PROCESSINGbuild andactor.start(build=build_number)was rejected.Fix: After triggering the rebuild, poll client-side via
client.build(<id>).wait_for_finish(wait_secs=900)— which uses long-poll requests and actually waits up to the requested duration — then assertstatus == 'SUCCEEDED'before passing the build toactor.start().2.
apify push120s timeout was too tight for heavier templatesThe
poetry-curl-impersonate-adaptive-parselvariant times out on every rerun (example):apify pushwaits server-side for the Docker build to finish before returning. The captured stderr shows a ~550 MB base image mid-download when the timeout fires — the CLI isn't hung, the build is just legitimately slower than 120s for heavier templates. Job total (522s ≈ 4 × 120s) confirms every rerun hits the same wall, so retries don't help.Fix: Bump all three apify-cli
subprocess.runtimeouts (login,init,push) from 120s to 600s. The 1800spytest-timeoutper test still bounds a truly hung CLI;@pytest.mark.flaky(reruns=3)still covers transient network/CLI flakes.