Skip to content

test: Fix flaky test_request_reclaim_functionality[shared] integration test#803

Open
vdusek wants to merge 1 commit intomasterfrom
test/fix-flaky-request-reclaim-test
Open

test: Fix flaky test_request_reclaim_functionality[shared] integration test#803
vdusek wants to merge 1 commit intomasterfrom
test/fix-flaky-request-reclaim-test

Conversation

@vdusek
Copy link
Contributor

@vdusek vdusek commented Feb 18, 2026

Summary

  • Add retry logic to fetch_next_request() calls in test_request_reclaim_functionality to handle propagation delays in shared request queue access mode
  • The [shared] variant was flaky because newly added or reclaimed requests may not be immediately visible
  • Introduces a _fetch_next_request_with_retry() helper that polls up to 10 times with 1-second intervals

Test plan

  • CI integration tests pass consistently for both [single] and [shared] variants

🤖 Generated with Claude Code

…n test

Add retry logic to fetch_next_request() calls in the reclaim test to handle
propagation delays in shared request queue access mode. The shared mode may
have a brief delay before newly added or reclaimed requests become visible.

See: https://github.com/apify/apify-sdk-python/actions/runs/22150409354/job/64039850655?pr=793

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@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 Feb 18, 2026
@vdusek vdusek self-assigned this Feb 18, 2026
@vdusek vdusek requested a review from Pijukatel February 18, 2026 17:35
@github-actions github-actions bot added this to the 134th sprint - Tooling team milestone Feb 18, 2026
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Feb 18, 2026
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.43%. Comparing base (e1bdbc9) to head (4260b08).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #803      +/-   ##
==========================================
- Coverage   85.47%   85.43%   -0.04%     
==========================================
  Files          46       46              
  Lines        2691     2691              
==========================================
- Hits         2300     2299       -1     
- Misses        391      392       +1     
Flag Coverage Δ
e2e 35.48% <ø> (?)
integration 57.59% <ø> (-0.04%) ⬇️
unit 72.38% <ø> (ø)

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.

Comment on lines +231 to +232
# Fetch and reclaim the request (retry to handle propagation delay in shared mode)
request = await _fetch_next_request_with_retry(rq)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the integration test shows intended usage, I think we're not actually fixing anything. We're just sweeping an issue under the rug.

In other words, this is not a flaky test, this shows the code under test being unreliable.

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

Comments