Skip to content

test: poll for dataset items in crawlee e2e tests - #1086

Merged
vdusek merged 1 commit into
masterfrom
worktree-fix-test-1
Aug 11, 2026
Merged

test: poll for dataset items in crawlee e2e tests#1086
vdusek merged 1 commit into
masterfrom
worktree-fix-test-1

Conversation

@vdusek

@vdusek vdusek commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

test_playwright_crawler failed on master (run 31375518173) with AssertionError: Missing product: Widget A / assert 'Widget A' in {}, while the run itself succeeded and assert items.count == 3 passed on the line above.

The dataset read in verify_crawler_results happens immediately after the run finishes. The API returned an empty item list while its pagination headers already reported the final item count, and DatasetItemsPage.count is max(x-apify-pagination-count, len(items)) - so the count assertion passed on the headers alone and the test only broke once it looked at the items.

The read now polls with poll_until_condition (30s ceiling) until all pushed items are returned, and asserts on len(items.items) instead of the header-derived count, which was the misleading part. The helper is shared by all six crawler e2e tests.

Verified by replaying the exact response shape from CI (empty items, count=3): the old helper reproduces Missing product: Widget A, the new one passes after polling, an immediately consistent read still takes a single call, and wrong or extra items still fail fast. tests/e2e/test_crawlee against the platform: test_playwright_crawler, test_adaptive_playwright_crawler, test_http_crawler and test_basic_crawler pass; test_parsel_crawler and test_beautifulsoup_crawler could not run on my account (Actor-count limit), they fail before reaching this helper.

✍️ 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 Aug 11, 2026
@vdusek vdusek self-assigned this Aug 11, 2026
@github-actions github-actions Bot added this to the 147th sprint - Tooling team milestone Aug 11, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Aug 11, 2026
@vdusek vdusek changed the title test: poll for dataset items in crawlee e2e verification test: poll for dataset items in crawlee e2e tests Aug 11, 2026
@vdusek
vdusek requested a review from Pijukatel August 11, 2026 07:39
@vdusek
vdusek marked this pull request as ready for review August 11, 2026 07:39
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.18%. Comparing base (3212e1c) to head (b758064).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1086      +/-   ##
==========================================
- Coverage   92.24%   92.18%   -0.07%     
==========================================
  Files          51       51              
  Lines        3249     3249              
==========================================
- Hits         2997     2995       -2     
- Misses        252      254       +2     
Flag Coverage Δ
e2e 35.24% <ø> (ø)
integration 56.66% <ø> (ø)
unit 84.45% <ø> (-0.07%) ⬇️

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 merged commit fb1356a into master Aug 11, 2026
31 checks passed
@vdusek
vdusek deleted the worktree-fix-test-1 branch August 11, 2026 08:06
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