Repository navigation
test: stabilize test_actor_last_run against concurrent run deletions - #1190
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1190 +/- ##
==========================================
+ Coverage 90.35% 95.66% +5.30%
==========================================
Files 61 61
Lines 6461 6461
==========================================
+ Hits 5838 6181 +343
+ Misses 623 280 -343
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vdusek
marked this pull request as ready for review
November 2, 2026 09:18
apify-factory
approved these changes
Nov 2, 2026
apify-factory
left a comment
Contributor
There was a problem hiding this comment.
Looks good, nothing blocking.
🏭 Apify Factory auto approved ✅ — every gate opened, nobody had to knock
Every gate passed, and neither the reviewer nor a juror found anything a human needs to look at.
Approval locked to 6f34f2f86 · workflow run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_actor_last_runfailed on master (CI run) becauselast_run().get()returnedNoneright after the test's owncall()finished.The API serves
runs/lastin two steps. It looks up the newest non-deleted run, then forwards the request toGET /runs/{id}. Parallel integration tests on the same account keep finishing and deletingapify/hello-worldruns. When the newest run belongs to a sibling test and gets deleted between those two steps, the API answers 404. Locally, with a background loop finishing and deleting runs, about 1 in 1000last_run().get()calls returnedNone.The test now polls until it gets a run that started no earlier than its own, the same approach
test_task_last_runuses. Its own run stays alive until cleanup, so the condition always holds eventually. It also assertsstarted_atinstead of only checking thatidis set.✍️ Drafted by Claude Code