Skip to content

tests: fix flaky tests with timing-sensitive assertions#1801

Merged
vdusek merged 2 commits intomasterfrom
fix/flaky-recurring-task-test
Mar 19, 2026
Merged

tests: fix flaky tests with timing-sensitive assertions#1801
vdusek merged 2 commits intomasterfrom
fix/flaky-recurring-task-test

Conversation

@vdusek
Copy link
Collaborator

@vdusek vdusek commented Mar 19, 2026

  • test_execution: Increased asyncio.sleep from 0.1s to 0.2s — the 30ms recurring task had only ~10ms of headroom for 3 calls, causing flakes on loaded CI runners.
  • test_adaptive_playwright_crawler_timeout_in_sub_crawler: On slow Windows CI, Playwright browser startup exceeded the 10s relaxed timeout, causing the browser fallback to fail and trigger a retry that called the static handler twice. Fixed by increasing the relaxed timeout to 120s and setting max_request_retries=0 (test validates fallback, not retries).

🤖 Generated with Claude Code

vdusek and others added 2 commits March 19, 2026 08:44
The test_execution test expected >= 3 calls with a 30ms delay but only
slept 100ms, leaving ~10ms of headroom. On loaded CI runners, asyncio
scheduling jitter caused only 2 calls, failing the assertion. Doubling
the sleep to 200ms provides a comfortable margin.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
On slow Windows CI, Playwright browser startup exceeded the 10s relaxed
timeout, causing the browser fallback to fail. BasicCrawler then retried
the request, and the retry's static crawl succeeded (using the mutated
timeout), calling the static handler a second time.

Fix: increase relaxed timeout to 120s for slow CI, and set
max_request_retries=0 since the test validates fallback, not retries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@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 Mar 19, 2026
@vdusek vdusek self-assigned this Mar 19, 2026
@github-actions github-actions bot added this to the 136th sprint - Tooling team milestone Mar 19, 2026
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Mar 19, 2026
@vdusek vdusek changed the title fix(test): fix flaky tests with timing-sensitive assertions tests: fix flaky tests with timing-sensitive assertions Mar 19, 2026
@vdusek vdusek requested a review from janbuchar March 19, 2026 07:57
@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.23%. Comparing base (6f2ac13) to head (7586376).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1801      +/-   ##
==========================================
- Coverage   92.25%   92.23%   -0.02%     
==========================================
  Files         157      157              
  Lines       10847    10847              
==========================================
- Hits        10007    10005       -2     
- Misses        840      842       +2     
Flag Coverage Δ
unit 92.23% <ø> (-0.02%) ⬇️

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.

Copy link
Collaborator

@janbuchar janbuchar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷

@vdusek vdusek merged commit edf1ee8 into master Mar 19, 2026
32 checks passed
@vdusek vdusek deleted the fix/flaky-recurring-task-test branch March 19, 2026 12:02
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