Skip to content

test: fix flaky webhook dispatch pagination test#843

Open
vdusek wants to merge 1 commit into
masterfrom
test/fix-webhook-dispatch-pagination-flake
Open

test: fix flaky webhook dispatch pagination test#843
vdusek wants to merge 1 commit into
masterfrom
test/fix-webhook-dispatch-pagination-flake

Conversation

@vdusek
Copy link
Copy Markdown
Contributor

@vdusek vdusek commented Jun 2, 2026

What & why

test_webhook_dispatch_list_pagination was flaky on CI (failing run).

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.

The offset assertion compared two desc-ordered pages; dispatches created by
parallel tests shifted the window between calls, making both pages start with
the same id. Query in ascending order so the window is anchored to the stable
oldest dispatches.
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Jun 2, 2026
@vdusek vdusek self-assigned this Jun 2, 2026
@github-actions github-actions Bot added this to the 142nd sprint - Tooling team milestone Jun 2, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Jun 2, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.52%. Comparing base (beab127) to head (170600a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #843   +/-   ##
=======================================
  Coverage   83.52%   83.52%           
=======================================
  Files          48       48           
  Lines        5045     5045           
=======================================
  Hits         4214     4214           
  Misses        831      831           
Flag Coverage Δ
unit 83.52% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants