Conversation
…tialization The fixed `asyncio.sleep(10)` waits weren't always enough for Apify platform stats to propagate, causing intermittent CI failures. Switch to the existing `poll_until_condition` helper used elsewhere in the file.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #882 +/- ##
==========================================
- Coverage 87.04% 87.01% -0.04%
==========================================
Files 48 48
Lines 2942 2942
==========================================
- Hits 2561 2560 -1
- Misses 381 382 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Fixes flakiness in
test_cache_initialization(integration tests, see run 25099976014).The test used fixed
asyncio.sleep(10)waits to give Apify platform stats time to propagate. In CI, 10s wasn't always enough —read_countwas still0after the second sleep, so the assertion failed even though the cache had been initialized correctly.Switched to the existing
poll_until_conditionhelper (already used elsewhere in this file for the same purpose). It callsget_metadataimmediately, then polls every 5s up to a 60s timeout — faster in the happy path, more tolerant of platform lag in the slow path. Real regressions still fail the test; only the propagation-timing flake is masked.