Skip to content

test: unify polling helpers with apify-sdk-python#837

Draft
vdusek wants to merge 1 commit into
masterfrom
test/unify-polling-helpers
Draft

test: unify polling helpers with apify-sdk-python#837
vdusek wants to merge 1 commit into
masterfrom
test/unify-polling-helpers

Conversation

@vdusek
Copy link
Copy Markdown
Contributor

@vdusek vdusek commented May 29, 2026

Adds generic call_with_exp_backoff and poll_until_condition test helpers with signatures shared across apify-sdk-python, crawlee-python, and apify-client-python. Both accept sync or async callables (via a small _maybe_await helper, typed with overloads), which fits this repo's sync/async client duality.

collect_iterate_until_present is rebuilt on top of poll_until_condition: the iterate/drain logic stays, but the polling loop is delegated to the shared helper. The contract is unchanged — the last collected list is returned so callers keep asserting with their own failure messages.

Lint, type-check, and test collection pass; integration tests require a platform token and were not run locally.

Add generic call_with_exp_backoff and poll_until_condition test helpers,
matching the signatures shared with apify-sdk-python and crawlee-python.
Both accept sync or async callables (via a small _maybe_await helper,
typed with overloads), which fits this repo's sync/async client duality.

Rebuild collect_iterate_until_present on top of poll_until_condition: the
iterate/drain logic stays, but the polling loop is delegated to the shared
helper. The contract is unchanged - the last collected list is returned so
callers keep asserting with their own failure messages.
@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 May 29, 2026
@vdusek vdusek self-assigned this May 29, 2026
@github-actions github-actions Bot added this to the 141st sprint - Tooling team milestone May 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.68%. Comparing base (1c84371) to head (55be4ad).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #837      +/-   ##
==========================================
- Coverage   94.72%   94.68%   -0.04%     
==========================================
  Files          48       48              
  Lines        5045     5045              
==========================================
- Hits         4779     4777       -2     
- Misses        266      268       +2     
Flag Coverage Δ
integration 93.00% <ø> (+0.09%) ⬆️
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.

@vdusek vdusek marked this pull request as draft May 29, 2026 17:04
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants