Skip to content

test: Harden e2e templates test against transient apify-cli flakes#1905

Merged
vdusek merged 2 commits into
masterfrom
test/harden-e2e-templates-flakes
May 20, 2026
Merged

test: Harden e2e templates test against transient apify-cli flakes#1905
vdusek merged 2 commits into
masterfrom
test/harden-e2e-templates-flakes

Conversation

@vdusek
Copy link
Copy Markdown
Collaborator

@vdusek vdusek commented May 20, 2026

Summary

Today's scheduled run had the playwright_chrome+impit+pip variant of test_static_crawler_actor_at_apify hang on apify push for the full 30-minute pytest-timeout window (job log). Yesterday it was a different combination — these are transient apify-cli / network flakes, not a code bug.

Two test-infrastructure fixes:

  • @pytest.mark.flaky(reruns=3) on test_static_crawler_actor_at_apify, plus timeout=120 on every apify-cli subprocess.run (login, init, push). A hung CLI now fails fast instead of burning the whole pytest-timeout window; the reruns absorb the transient.
  • Fix rerun=reruns= kwarg typo in five existing @pytest.mark.flaky decorators. pytest-rerunfailures reads reruns (plural) — the typo silently meant 1 retry instead of 3 for the affected unit tests.

The Stagehand ECONNREFUSED failures from the same scheduled run are a separate bug, fixed in #1906.

- 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.
@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels May 20, 2026
@vdusek vdusek self-assigned this May 20, 2026
@github-actions github-actions Bot added this to the 141st sprint - Tooling team milestone May 20, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label May 20, 2026
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
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.88%. Comparing base (e929d38) to head (7db038b).

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     
Flag Coverage Δ
unit 92.88% <ø> (-0.07%) ⬇️

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.

@vdusek vdusek merged commit feec30d into master May 20, 2026
33 checks passed
@vdusek vdusek deleted the test/harden-e2e-templates-flakes branch May 20, 2026 10:16
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.

2 participants