Class: CI::Queue::Redis::Retry
- Defined in:
- lib/ci/queue/redis/retry.rb
Constant Summary
Constants inherited from Static
Constants included from Common
Instance Attribute Summary
Attributes inherited from Static
#entry_resolver, #progress, #total
Attributes included from Common
Instance Method Summary collapse
-
#acknowledge(entry, error: nil, pipeline: redis) ⇒ Object
Queue a Redis SADD so that BuildRecord#record_success can include this in its multi-exec transaction.
- #build ⇒ Object
-
#initialize(tests, config, redis:) ⇒ Retry
constructor
A new instance of Retry.
-
#stream_populate(tests, random: nil, batch_size: nil) ⇒ Object
Retry queue is pre-populated with failed test entries from the previous run.
Methods inherited from Static
#boot_heartbeat_process!, #created_at=, #distributed?, #ensure_heartbeat_thread_alive!, #exhausted?, #expired?, from_uri, #increment_test_failed, #lease_for, #max_test_failed?, #poll, #populate, #populated?, #queue_initialized?, #remaining, #report_worker_error, #requeue, #retry_queue, #running, #shutdown!, #size, #stop_heartbeat!, #supervisor, #test_failed, #to_a, #with_heartbeat
Methods included from Common
#distributed?, #flaky?, #release!, #report_failure!, #report_success!, #rescue_connection_errors, #retrying?
Constructor Details
#initialize(tests, config, redis:) ⇒ Retry
Returns a new instance of Retry.
6 7 8 9 |
# File 'lib/ci/queue/redis/retry.rb', line 6 def initialize(tests, config, redis:) @redis = redis super(tests, config) end |
Instance Method Details
#acknowledge(entry, error: nil, pipeline: redis) ⇒ Object
Queue a Redis SADD so that BuildRecord#record_success can include this in its multi-exec transaction. Without this, Static#acknowledge returns a Ruby value (not a Redis future), shifting the result indices and breaking the stats delta correction.
35 36 37 38 39 40 |
# File 'lib/ci/queue/redis/retry.rb', line 35 def acknowledge(entry, error: nil, pipeline: redis) @progress += 1 return @progress unless pipeline test_id = CI::Queue::QueueEntry.test_id(entry) pipeline.sadd(key('processed'), test_id) end |
#build ⇒ Object
11 12 13 |
# File 'lib/ci/queue/redis/retry.rb', line 11 def build @build ||= CI::Queue::Redis::BuildRecord.new(self, redis, config) end |
#stream_populate(tests, random: nil, batch_size: nil) ⇒ Object
Retry queue is pre-populated with failed test entries from the previous run. Don’t replace them with the full preresolved/lazy test list. QueuePopulationStrategy#configure_lazy_queue will still set entry_resolver, so poll uses LazyEntryResolver to lazily load test files on demand. The random/batch_size params are intentionally ignored since we keep the existing queue contents as-is.
Note: populate (non-stream) is intentionally NOT overridden here. RSpec and non-lazy Minitest retries call populate to build the yield proper test/example instances. In those paths, @queue contains bare test IDs that match @index keys, so populate works correctly.
27 28 29 |
# File 'lib/ci/queue/redis/retry.rb', line 27 def stream_populate(tests, random: nil, batch_size: nil) self end |