SIGN IN SIGN UP

test: fix flaky webhook dispatch pagination test (#843)

## What & why

`test_webhook_dispatch_list_pagination` was flaky on CI ([failing
run](https://github.com/apify/apify-client-python/actions/runs/26631332682/job/78480663231)).

The offset check fetched two `desc=True` (newest-first) pages and
asserted they start with different ids. But webhook dispatches created
by other tests running in parallel land at the **head** of the
desc-ordered list, shifting the window between the two calls. When ≥5
new dispatches appeared between the calls, page 1's first item slid to
offset 5 — so both pages started with the same id and the assertion
failed.

## Fix

Query the offset window in **ascending** order (`desc=False`) so it's
anchored to the oldest dispatches. New dispatches append at the tail,
leaving the front window stable, and the global-oldest item can never
reach offset 5. This is race-free while still exercising the `offset`
parameter. The `desc=True` ordering assertion is kept unchanged.
V
Vlada Dusek committed
25cd8e9936849b4b149a6e9659ddf4a50adde2a2
Parent: d2ab2ae
Committed by GitHub <noreply@github.com> on 6/4/2026, 6:46:34 AM