Commit 4e7a566
authored
test: Deflake test_schedule_list and test_task_list by polling eventually consistent listings (#951)
`test_schedule_list` and `test_task_list` failed in CI ([schedule
run](https://github.com/apify/apify-client-python/actions/runs/29497290807/job/87617167353),
[task
run](https://github.com/apify/apify-client-python/actions/runs/29498108478/job/87619855853))
because they assert read-your-write on listing endpoints: they list
resources immediately after creating them, and under load the listing
can serve a view that hasn't yet caught up with the creates, so the
fresh IDs are sometimes missing. The creates themselves succeeded in
both cases, so these are eventual-consistency flakes, not client bugs.
The fix wraps each list read in the existing `poll_until_condition`
helper (30 s ceiling), waiting until the created IDs appear in the
listing. The original assertions still run on the final page, so a real
regression still fails. Follows the same deflaking pattern as #824,
#831, #844, and #868.1 parent 5ad7c91 commit 4e7a566
2 files changed
Lines changed: 22 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
113 | 119 | | |
114 | 120 | | |
115 | 121 | | |
| |||
0 commit comments