Repository navigation
Commit f739c77
authored
test: Deflake webhook dispatches iterate test by polling for the dispatch (#1047)
`test_webhook_dispatches_iterate` drained `dispatches().iterate()` once,
right after `webhook_client.test()`. The dispatch is recorded
asynchronously, so under load the listing can still be empty (`total=0`)
and the test fails with `assert 0 >= 1` ([failed
run](https://github.com/apify/apify-client-python/actions/runs/33614701601/job/100197733391)).
The sibling `test_webhook_dispatches` failed the same way twice before
and got a poll in #1004; the iterate variant did not.
The test now keeps the dispatch returned by `test()` and drains the
iterator via `collect_iterate_until_present` until that ID shows up,
then asserts membership, which is stricter than the previous "at least
one dispatch" check.
*✍️ Drafted by Claude Code*1 parent 6d2d878 commit f739c77
1 file changed
Lines changed: 11 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
259 | 258 | | |
260 | 259 | | |
261 | 260 | | |
262 | | - | |
263 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
264 | 264 | | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
281 | 273 | | |
282 | 274 | | |
0 commit comments