Skip to content

Commit 5f40198

Browse files
authored
Merge pull request #340 from anmarchenko/main
Fix a crash with acknowledge keyword when using static queue
2 parents 1bdfb52 + 53e948a commit 5f40198

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

ruby/lib/ci/queue/build_record.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def record_error(id, payload, stats: nil)
2323
record_stats(stats)
2424
end
2525

26-
def record_success(id, stats: nil, skip_flaky_record: false)
26+
def record_success(id, stats: nil, skip_flaky_record: false, acknowledge: true)
2727
error_reports.delete(id)
2828
record_stats(stats)
2929
end

ruby/test/minitest/queue/build_status_recorder_test.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,20 @@ def test_retrying_test
7676
assert_equal 0, summary.error_reports.size
7777
end
7878

79+
def test_static_queue_record_success
80+
static_queue = CI::Queue::Static.new(['test_example'], CI::Queue::Configuration.new(build_id: '42', worker_id: '1'))
81+
static_reporter = BuildStatusRecorder.new(build: static_queue.build)
82+
static_reporter.start
83+
84+
static_reporter.record(result('test_example'))
85+
86+
assert_equal 1, static_reporter.assertions
87+
assert_equal 0, static_reporter.failures
88+
assert_equal 0, static_reporter.errors
89+
assert_equal 0, static_reporter.skips
90+
assert_equal 0, static_reporter.requeues
91+
end
92+
7993
private
8094

8195
def reserve(queue, method_name)

0 commit comments

Comments
 (0)