Skip to content

ruby: Replay worker history with existing retry queue - #97

Closed
yfang-figma wants to merge 5 commits into
masterfrom
yfang-figma/worker-history-retry-alternative
Closed

ruby: Replay worker history with existing retry queue#97
yfang-figma wants to merge 5 commits into
masterfrom
yfang-figma/worker-history-retry-alternative

Conversation

@yfang-figma

@yfang-figma yfang-figma commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What changed

This is an alternative implementation of #96 that replays a retried worker reservation history through the existing CI::Queue::Redis::Retry queue.

  • Add opt-in --retry-mode worker-history behavior while preserving failure-only retries by default.
  • Expand suite-bin-packing reservations into their original test IDs and deduplicate in first-reservation order.
  • Replay the reconstructed history locally and exit instead of returning to the shared Redis queue.
  • Fail the worker when shutdown or another cutoff stops history replay before the local retry queue is exhausted.
  • Make static/retry queues honor shutdown signals.

Why

SimpleCov data is process-local. When a distributed worker is terminated, coverage for tests that passed before termination is lost, while the existing Ruby retry path selects only failed tests from that worker reservation log.

Ruby historically retried the complete worker log, and the Python implementation still does. Reusing the existing local retry queue restores that model as an opt-in mode without introducing a two-phase queue wrapper that must proxy the Redis worker interface.

Behavioral difference from #96

After reconstructing coverage, this implementation exits. It does not resume claiming work from the shared queue. This matches current failure-retry behavior and the Python whole-worker retry path. If shared-queue resumption is a required production scenario, #96 second phase remains the meaningful tradeoff.

Validation

  • test/ci/queue/redis_test.rb
  • bundle exec rake build

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