Skip to content

test: poll for task runs to fix flaky integration tests - #1123

Merged
vdusek merged 1 commit into
masterfrom
test/flaky-task-runs-list
Oct 13, 2026
Merged

vdusek merged 1 commit into
masterfrom
test/flaky-task-runs-list

Conversation

@vdusek

@vdusek vdusek commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

test_task_runs failed on master (run 38285189656) with assert 0 >= 1: the task's run list was empty right after call() returned. The run listing is eventually consistent, so a read straight after the run finishes can miss it. The JS client hit the same flake in apify/apify-client-js#1136.

Both test_task_runs and test_task_last_run now poll with poll_until_condition until the API returns the run that call() started. test_task_runs also checks for that run's id instead of just a non-empty page.

✍️ Drafted by Claude Code

@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 Oct 13, 2026
@vdusek vdusek self-assigned this Oct 13, 2026
@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.46%. Comparing base (7fec14a) to head (34738bc).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1123   +/-   ##
=======================================
  Coverage   95.46%   95.46%           
=======================================
  Files          61       61           
  Lines        5935     5935           
=======================================
  Hits         5666     5666           
  Misses        269      269           
Flag Coverage Δ
integration 90.58% <ø> (-0.02%) ⬇️
unit 88.87% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

@vdusek
vdusek requested a review from Mantisus October 13, 2026 08:44
@vdusek
vdusek marked this pull request as ready for review October 13, 2026 08:44
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Oct 13, 2026

@Mantisus Mantisus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@apify-approval-mirror apify-approval-mirror Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mirroring approval from @Mantisus.

@vdusek
vdusek merged commit f44557c into master Oct 13, 2026
32 of 37 checks passed
@vdusek
vdusek deleted the test/flaky-task-runs-list branch October 13, 2026 08:55
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.

3 participants