Skip to content

Reduce flaky integration test failures from timing and PK reuse#758

Open
rafael-pissardo wants to merge 1 commit into
rails:mainfrom
rafael-pissardo:fix/flake-test-isolation
Open

Reduce flaky integration test failures from timing and PK reuse#758
rafael-pissardo wants to merge 1 commit into
rails:mainfrom
rafael-pissardo:fix/flake-test-isolation

Conversation

@rafael-pissardo

Copy link
Copy Markdown

Summary

  • Hardens flaky integration tests that fail intermittently on main CI (unrelated to feature PRs).
  • Concurrency controls: wait for prior supervisors to deregister before creating JobResult rows (avoids recycled PK overwrites from orphaned StoreResultJob writers turning status into "completed"), wait for claimed slots before enqueueing blocked jobs, and adopt the claimed-release wait pattern from Fix flaky concurrency controls test #734.
  • Recurring tasks: assert only on custom_status / value: 42 results so leftover rows cannot fail the suite.
  • Lifecycle: wait for async supervisor exit (instead of a fixed 1s sleep) and wait for FailedExecution records in the jobs failure path.

Related to #602.

Test plan

  • bin/rails test test/integration/concurrency_controls_test.rb test/integration/recurring_tasks_test.rb test/integration/jobs_lifecycle_test.rb test/integration/async_processes_lifecycle_test.rb
  • Local stress: concurrency file ×10 and flaky cases ×20
  • CI green across the matrix

Made with Cursor

Isolation fixes for concurrency/recurring/lifecycle tests that flake on
CI: wait for process deregistration and claimed slots, avoid JobResult
primary-key reuse from orphaned StoreResultJob writers, scope recurring
assertions, and replace fixed sleeps with condition waits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant