Skip to content

Conversation

@vdusek
Copy link
Contributor

@vdusek vdusek commented Feb 11, 2026

Summary

  • test_large_batch_operations was flaky because fetch_next_request() can temporarily return None due to eventual consistency in the Apify API, even when is_empty() reports requests still exist
  • Replaced the while not is_empty + hard assert request is not None pattern with a retry loop that tolerates up to 10 consecutive empty fetches (with 0.5s sleep between retries) before concluding the queue is drained
  • The final assertions (processed_count == 500 and is_finished) remain unchanged and still validate correctness

Test plan

  • Lint passes (uv run poe lint)
  • Unit tests pass (uv run poe unit-tests)
  • Integration tests pass in CI (the previously flaky test should now be stable)

🤖 Generated with Claude Code

…fetches

The test was flaky because fetch_next_request() can temporarily return None
due to eventual consistency in the Apify API, even when is_empty() reports
requests still exist. Replace the while-not-is_empty loop with a retry
pattern that tolerates up to 10 consecutive empty fetches before concluding
the queue is drained.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@vdusek vdusek marked this pull request as draft February 11, 2026 11:57
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.95%. Comparing base (cf36cc2) to head (8cb4a8a).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #780      +/-   ##
==========================================
- Coverage   68.02%   67.95%   -0.08%     
==========================================
  Files          46       46              
  Lines        2696     2696              
==========================================
- Hits         1834     1832       -2     
- Misses        862      864       +2     
Flag Coverage Δ
unit 67.95% <ø> (-0.08%) ⬇️

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.

@github-actions github-actions bot added this to the 134th sprint - Tooling team milestone Feb 11, 2026
@github-actions github-actions bot added t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics. labels Feb 11, 2026
@vdusek vdusek marked this pull request as ready for review February 11, 2026 11:59
@vdusek vdusek requested a review from Pijukatel February 11, 2026 11:59
@vdusek vdusek added the adhoc Ad-hoc unplanned task added during the sprint. label Feb 11, 2026
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.

1 participant