Repository navigation
Commit f312a3d
authored
test: stop test_actor_charge_limit from hanging on a late platform abort (#1203)
`test_actor_charge_limit` failed on master
([run](https://github.com/apify/apify-sdk-python/actions/runs/39613335682/job/119267706151))
with `TIMED-OUT` where it expected `ABORTED`. The SDK charged the
expected 3 events, but the platform never aborted the run. A background
daemon enforces `max_total_charge_usd`, and it usually aborts within
seconds. This time it didn't, and the test Actor waited on
`asyncio.Event().wait()` with no end, so the run sat until its 600 s
timeout.
The Actor now waits up to 60 s for the abort and then exits on its own.
The test accepts `ABORTED` or `SUCCEEDED`, as `test_ppe_spider` already
does, and still asserts the SDK side: `charged_event_counts ==
{'foobar': 3}`. When the daemon is on time, the run still ends as
`ABORTED`.
*✍️ Drafted by Claude Code*1 parent c30fdcd commit f312a3d
1 file changed
Lines changed: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
161 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
162 | 164 | | |
163 | 165 | | |
164 | | - | |
| 166 | + | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
169 | | - | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
0 commit comments