Skip to content

test: deflake is_finished assertions in shared request queue mode - #1087

Open
vdusek wants to merge 1 commit into
masterfrom
worktree-fix-test-2
Open

test: deflake is_finished assertions in shared request queue mode#1087
vdusek wants to merge 1 commit into
masterfrom
worktree-fix-test-2

Conversation

@vdusek

@vdusek vdusek commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

test_request_queue_is_finished_and_is_empty[shared] failed on master
(run 31375518173)
with assert not True.

In shared access mode is_finished() answers from the queue head listing, which is eventually
consistent: right after a committed add_request the head can still come back empty with no locked
requests, so the queue briefly reports itself as finished. The test asserted that negative condition
with a single immediate read, while every positive assertion around it already polls.

Both negative is_finished assertions now poll with poll_until_condition and the mode-appropriate
rq_poll_timeout, so they tolerate the propagation window without losing their meaning - in single
mode the timeout is 0, so it stays a single strict read, and a queue that never stops reporting
itself as finished still fails.

Verified by injecting the lag deterministically (first head listing after each add forced empty):
the current test reproduces the exact CI failure, the updated one passes 25/25 runs under the same
condition. The whole module also passes under --numprocesses=auto.

✍️ 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
@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.27%. Comparing base (3212e1c) to head (c763e75).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1087      +/-   ##
==========================================
+ Coverage   92.24%   92.27%   +0.03%     
==========================================
  Files          51       51              
  Lines        3249     3249              
==========================================
+ Hits         2997     2998       +1     
+ Misses        252      251       -1     
Flag Coverage Δ
e2e 35.24% <ø> (ø)
integration 56.69% <ø> (+0.03%) ⬆️
unit 84.51% <ø> (ø)

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 Pijukatel August 11, 2026 08:02
@vdusek
vdusek marked this pull request as ready for review August 11, 2026 08:02
@Pijukatel

Copy link
Copy Markdown
Contributor

Maybe the is_finished when returning True, should be double-checked(or inspected in other way) due to eventual consistency to prevent something like this:
https://apify.slack.com/archives/C0L33UM7Z/p1785322628993809

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