Skip to content

test: fix flaky waits in crawler pause and stop tests - #2554

Merged
vdusek merged 2 commits into
v2from
test/fix-flaky-migration-after-stop
Nov 30, 2026
Merged

vdusek merged 2 commits into
v2from
test/fix-flaky-migration-after-stop

Conversation

@vdusek

@vdusek vdusek commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

test_migration_after_stop_ends_run waited for the first request handler with poll_until_condition, which gives up after 5 seconds. A macOS CI run stalled the worker process for more than 5 seconds, so the poll returned False before the handler started (failed job). Other crawler tests in the same run stalled for 6 to 10 seconds too, so the stall came from the runner, not the crawler.

Eight more pause, stop, and migration tests in test_basic_crawler.py used the same 5-second wait for the crawler start. In those 7 tests and the original one, the handler now sets an asyncio.Event, and the test waits for it with a 30-second ceiling. test_pause_after_abort_on_error_ends_run waits for failed_request_handler, so it keeps the poll with a 30-second timeout. The pause_task and run_task waits in these tests also go from 10 to 30 seconds.

A simulated 6-second stall during the crawler start fails all 9 tests before this change and passes them after it.

✍️ Drafted by Claude Code

@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 Nov 30, 2026
@vdusek vdusek self-assigned this Nov 30, 2026
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (v2@f1a68d3). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff          @@
##             v2    #2554   +/-   ##
=====================================
  Coverage      ?   95.58%           
=====================================
  Files         ?      196           
  Lines         ?    15552           
  Branches      ?        0           
=====================================
  Hits          ?    14865           
  Misses        ?      687           
  Partials      ?        0           
Flag Coverage Δ
integration 75.52% <ø> (?)
unit 89.84% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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 changed the title test: fix flaky test_migration_after_stop_ends_run test: fix flaky waits in crawler pause and stop tests Nov 30, 2026
@vdusek
vdusek marked this pull request as ready for review November 30, 2026 16:54
@vdusek
vdusek merged commit 8b5f355 into v2 Nov 30, 2026
44 checks passed
@vdusek
vdusek deleted the test/fix-flaky-migration-after-stop branch November 30, 2026 17:06
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant