ci-queue 0.71.0 → 0.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ci/queue/redis/build_record.rb +8 -2
- data/lib/ci/queue/redis/requeue.lua +3 -0
- data/lib/ci/queue/redis/worker.rb +1 -0
- data/lib/ci/queue/version.rb +1 -1
- data/lib/minitest/queue/build_status_recorder.rb +3 -1
- data/lib/minitest/queue/build_status_reporter.rb +15 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f5093c0f80a695ec2f8b30b8eb72ca58ca809a7e55aa7c0c6177a01acf7ac67
|
4
|
+
data.tar.gz: 53be96ee18a7cdec0ef60d8a367aced59c271e2db2d73c0019a30d50a62d8cce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3091461df678a23e28e72b5e35922a51e85aeda474f362ab94ddd49db11420c5a686eb3684313ceda2f7d725d169992ec4f76481eecbc035f6c5c494879c0d8c
|
7
|
+
data.tar.gz: aa81619322c27cc1370da7a2b3c4b9118e2fde8b8401eb13b73788a24cdddab3caab327470baa03968dba04e5b50de8fa28cd0023a8ecccd48ccd81a60f0950f
|
data/Gemfile.lock
CHANGED
@@ -65,9 +65,9 @@ module CI
|
|
65
65
|
nil
|
66
66
|
end
|
67
67
|
|
68
|
-
def record_success(id, stats: nil, skip_flaky_record: false
|
68
|
+
def record_success(id, stats: nil, skip_flaky_record: false)
|
69
69
|
_, error_reports_deleted_count, requeued_count, _ = redis.multi do |transaction|
|
70
|
-
@queue.acknowledge(id, pipeline: transaction)
|
70
|
+
@queue.acknowledge(id, pipeline: transaction)
|
71
71
|
transaction.hdel(key('error-reports'), id)
|
72
72
|
transaction.hget(key('requeues-count'), id)
|
73
73
|
record_stats(stats, pipeline: transaction)
|
@@ -76,6 +76,12 @@ module CI
|
|
76
76
|
nil
|
77
77
|
end
|
78
78
|
|
79
|
+
def record_requeue(id, stats: nil)
|
80
|
+
redis.pipelined do |pipeline|
|
81
|
+
record_stats(stats, pipeline: pipeline)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
79
85
|
def record_flaky(id, stats: nil)
|
80
86
|
redis.pipelined do |pipeline|
|
81
87
|
pipeline.sadd?(
|
@@ -5,6 +5,7 @@ local queue_key = KEYS[3]
|
|
5
5
|
local zset_key = KEYS[4]
|
6
6
|
local worker_queue_key = KEYS[5]
|
7
7
|
local owners_key = KEYS[6]
|
8
|
+
local error_reports_key = KEYS[7]
|
8
9
|
|
9
10
|
local max_requeues = tonumber(ARGV[1])
|
10
11
|
local global_max_requeues = tonumber(ARGV[2])
|
@@ -32,6 +33,8 @@ end
|
|
32
33
|
redis.call('hincrby', requeues_count_key, '___total___', 1)
|
33
34
|
redis.call('hincrby', requeues_count_key, test, 1)
|
34
35
|
|
36
|
+
redis.call('hdel', error_reports_key, test)
|
37
|
+
|
35
38
|
local pivot = redis.call('lrange', queue_key, -1 - offset, 0 - offset)[1]
|
36
39
|
if pivot then
|
37
40
|
redis.call('linsert', queue_key, 'BEFORE', pivot, test)
|
data/lib/ci/queue/version.rb
CHANGED
@@ -51,8 +51,10 @@ module Minitest
|
|
51
51
|
stats = COUNTERS.zip(COUNTERS.map { |c| send(c) }).to_h
|
52
52
|
if (test.failure || test.error?) && !test.skipped?
|
53
53
|
build.record_error("#{test.klass}##{test.name}", dump(test), stats: stats)
|
54
|
+
elsif test.requeued?
|
55
|
+
build.record_requeue("#{test.klass}##{test.name}", stats: stats)
|
54
56
|
else
|
55
|
-
build.record_success("#{test.klass}##{test.name}", stats: stats, skip_flaky_record: test.skipped
|
57
|
+
build.record_success("#{test.klass}##{test.name}", stats: stats, skip_flaky_record: test.skipped?)
|
56
58
|
end
|
57
59
|
end
|
58
60
|
|
@@ -129,7 +129,7 @@ module Minitest
|
|
129
129
|
|
130
130
|
puts aggregates
|
131
131
|
|
132
|
-
if
|
132
|
+
if timed_out?
|
133
133
|
puts red("Timed out waiting for tests to be executed.")
|
134
134
|
|
135
135
|
remaining_tests = supervisor.test_ids
|
@@ -142,7 +142,7 @@ module Minitest
|
|
142
142
|
end
|
143
143
|
|
144
144
|
exit_code = TIMED_OUT_EXIT_CODE
|
145
|
-
elsif
|
145
|
+
elsif all_workers_died?
|
146
146
|
puts red("All workers died.")
|
147
147
|
exit_code = WORKERS_DIED_EXIT_CODE
|
148
148
|
elsif supervisor.max_test_failed?
|
@@ -167,7 +167,11 @@ module Minitest
|
|
167
167
|
|
168
168
|
def success?
|
169
169
|
build.error_reports.empty? &&
|
170
|
-
build.worker_errors.empty?
|
170
|
+
build.worker_errors.empty? &&
|
171
|
+
build.queue_exhausted? &&
|
172
|
+
!supervisor.max_test_failed? &&
|
173
|
+
!all_workers_died? &&
|
174
|
+
!timed_out?
|
171
175
|
end
|
172
176
|
|
173
177
|
def record(*)
|
@@ -220,6 +224,14 @@ module Minitest
|
|
220
224
|
|
221
225
|
attr_reader :build, :supervisor
|
222
226
|
|
227
|
+
def timed_out?
|
228
|
+
supervisor.time_left.to_i <= 0
|
229
|
+
end
|
230
|
+
|
231
|
+
def all_workers_died?
|
232
|
+
supervisor.time_left_with_no_workers.to_i <= 0
|
233
|
+
end
|
234
|
+
|
223
235
|
def aggregates
|
224
236
|
success = failures.zero? && errors.zero?
|
225
237
|
failures_count = "#{failures} failures, #{errors} errors,"
|