Commit b13af58
authored
test: Give Apify builds more time in scheduled e2e templates test (#1909)
## Summary
Two related scheduled e2e failures, both fixed by giving Apify builds
more time to complete.
### 1. Stagehand rebuild: `wait_for_finish=600` was silently clipped to
60s
The scheduled stagehand tests have been failing on every run since
[#1900](#1900) added the
post-`env_vars.create` rebuild
([example](https://github.com/apify/crawlee-python/actions/runs/26263684679/job/77302398839)):
```
apify_client.errors.ApifyApiError: The build has not finished or was not successful.
```
`ActorClientAsync.build()`'s `wait_for_finish` parameter 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, so `actor.build()` returned a still-`PROCESSING` build and
`actor.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 assert `status == 'SUCCEEDED'` before passing the build to
`actor.start()`.
### 2. `apify push` 120s timeout was too tight for heavier templates
The `poetry-curl-impersonate-adaptive-parsel` variant times out on every
rerun
([example](https://github.com/apify/crawlee-python/actions/runs/26263684679/job/77302398558)):
```
subprocess.TimeoutExpired: Command '['apify', 'push']' timed out after 120 seconds
```
`apify push` waits 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.run` timeouts (`login`,
`init`, `push`) from 120s to 600s. The 1800s `pytest-timeout` per test
still bounds a truly hung CLI; `@pytest.mark.flaky(reruns=3)` still
covers transient network/CLI flakes.1 parent 41433a3 commit b13af58
1 file changed
Lines changed: 14 additions & 5 deletions
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
137 | 146 | | |
138 | 147 | | |
139 | 148 | | |
| |||
0 commit comments