test: Harden e2e templates test against transient apify-cli flakes#1905
Merged
Conversation
- Add `@pytest.mark.flaky(reruns=3)` to `test_static_crawler_actor_at_apify` and `timeout=120/600` to the apify-cli `subprocess.run` calls. A scheduled run today had a `playwright_chrome+impit+pip` variant hang on `apify push` for the full 30 min pytest-timeout window. The timeout makes a hung CLI fail fast; the reruns absorb the resulting transient. - Fix `rerun=` → `reruns=` kwarg typo in five existing `@pytest.mark.flaky` decorators. `pytest-rerunfailures` reads `reruns` (plural); the typo silently fell back to 1 retry instead of 3.
Match the timeout used for `apify login` / `apify init`. A healthy `apify push` finishes in 2–3 minutes; 120s leaves headroom for normal builds while making a hang fail much sooner.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1905 +/- ##
==========================================
- Coverage 92.95% 92.88% -0.07%
==========================================
Files 167 167
Lines 11709 11709
==========================================
- Hits 10884 10876 -8
- Misses 825 833 +8
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
Today's scheduled run had the
playwright_chrome+impit+pipvariant oftest_static_crawler_actor_at_apifyhang onapify pushfor the full 30-minutepytest-timeoutwindow (job log). Yesterday it was a different combination — these are transientapify-cli/ network flakes, not a code bug.Two test-infrastructure fixes:
@pytest.mark.flaky(reruns=3)ontest_static_crawler_actor_at_apify, plustimeout=120on everyapify-clisubprocess.run(login,init,push). A hung CLI now fails fast instead of burning the whole pytest-timeout window; the reruns absorb the transient.rerun=→reruns=kwarg typo in five existing@pytest.mark.flakydecorators.pytest-rerunfailuresreadsreruns(plural) — the typo silently meant 1 retry instead of 3 for the affected unit tests.The Stagehand
ECONNREFUSEDfailures from the same scheduled run are a separate bug, fixed in #1906.