ci-queue 0.54.0 → 0.56.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db80b6deb328b8a734e037a230660690812bb4123073e3ec0c3db5f1bee11e21
4
- data.tar.gz: 88ee3979041275c756d5a61107ada32d879e15d2111261b178cbf9503b1e30a4
3
+ metadata.gz: e463afd14fdd0af687967316891f41c3f6e8f227eeb4924b12448ce91749cf74
4
+ data.tar.gz: db803750f16b9a10ee3c5498b4c1eaa5df768247d39d7efa2abc3ae15a6efc00
5
5
  SHA512:
6
- metadata.gz: 3208f3d9164d15fad57e7b986b5018bc6c9c92371fff00c1acd9e13275ff723dfb825b76753fdcdc4fad7e6e1ac1f7c4ccf4c4e4e26f9a0a05f86a42e34e1f12
7
- data.tar.gz: 052fa12268780996dc85d819b7f4e7f551d5e5cc44cf6bb3c9fb88b4d8eece68318e3042e30c28962f39207c38f86139cb1ce1b90319e8bf283ef22c812018fd
6
+ metadata.gz: b99390737597eb6c3eb2faadff1dbb64b9dcd03b9a9906ed287350e35b164f60ea913e29227ebead7ebc98e10a088e394ae23051ed3c240d8c7b97b6bcb77cee
7
+ data.tar.gz: 6382ff6e7c0a486de687268b259046616c8299990b426255a415142e247991c38b7271cb31b4de0ded5dfe9ed12e20480fe7514a16542372a96e9ca6a650f7d4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ci-queue (0.54.0)
4
+ ci-queue (0.56.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -36,6 +36,14 @@ module CI
36
36
  stat_names.each { |s| stats.delete(s) }
37
37
  end
38
38
 
39
+ def report_worker_error(_); end
40
+
41
+ def reset_worker_error; end
42
+
43
+ def worker_errors
44
+ {}
45
+ end
46
+
39
47
  private
40
48
 
41
49
  attr_reader :stats
@@ -17,6 +17,21 @@ module CI
17
17
  @queue.exhausted?
18
18
  end
19
19
 
20
+ def report_worker_error(error)
21
+ redis.pipelined do |pipeline|
22
+ pipeline.hset(key('worker-errors'), config.worker_id, error.message)
23
+ pipeline.expire(key('worker-errors'), config.redis_ttl)
24
+ end
25
+ end
26
+
27
+ def worker_errors
28
+ redis.hgetall(key('worker-errors'))
29
+ end
30
+
31
+ def reset_worker_error
32
+ redis.hdel(key('worker-errors'), config.worker_id)
33
+ end
34
+
20
35
  def failed_tests
21
36
  redis.hkeys(key('error-reports'))
22
37
  end
@@ -95,6 +95,10 @@ module CI
95
95
  @build ||= CI::Queue::Redis::BuildRecord.new(self, redis, config)
96
96
  end
97
97
 
98
+ def report_worker_error(error)
99
+ build.report_worker_error(error)
100
+ end
101
+
98
102
  def acknowledge(test)
99
103
  test_key = test.id
100
104
  raise_on_mismatching_test(test_key)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CI
4
4
  module Queue
5
- VERSION = '0.54.0'
5
+ VERSION = '0.56.0'
6
6
  DEV_SCRIPTS_ROOT = ::File.expand_path('../../../../../redis', __FILE__)
7
7
  RELEASE_SCRIPTS_ROOT = ::File.expand_path('../redis', __FILE__)
8
8
  end
@@ -36,11 +36,18 @@ module Minitest
36
36
  puts ""
37
37
  end
38
38
 
39
+ build.worker_errors.to_a.sort.each do |worker_id, error|
40
+ puts yellow("Worker #{worker_id } crashed")
41
+ puts error
42
+ puts ""
43
+ end
44
+
39
45
  errors.empty?
40
46
  end
41
47
 
42
48
  def success?
43
- build.error_reports.empty?
49
+ build.error_reports.empty? &&
50
+ build.worker_errors.empty?
44
51
  end
45
52
 
46
53
  def record(*)
@@ -345,6 +345,7 @@ module Minitest
345
345
 
346
346
  def reset_counters
347
347
  queue.build.reset_stats(BuildStatusRecorder::COUNTERS)
348
+ queue.build.reset_worker_error
348
349
  end
349
350
 
350
351
  def populate_queue
@@ -266,6 +266,15 @@ module Minitest
266
266
  reopen_previous_step
267
267
  puts red("The heartbeat process died. This worker is exiting early.")
268
268
  exit!(41)
269
+ rescue => error
270
+ reopen_previous_step
271
+ queue.report_worker_error(error)
272
+ puts red("This worker exited because of an uncaught application error:")
273
+ puts red("#{error.class}: #{error.message}")
274
+ error.backtrace.each do |frame|
275
+ puts red(frame)
276
+ end
277
+ exit!(42)
269
278
  end
270
279
  end
271
280
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci-queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.54.0
4
+ version: 0.56.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-27 00:00:00.000000000 Z
11
+ date: 2024-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -227,7 +227,7 @@ licenses:
227
227
  - MIT
228
228
  metadata:
229
229
  allowed_push_host: https://rubygems.org
230
- post_install_message:
230
+ post_install_message:
231
231
  rdoc_options: []
232
232
  require_paths:
233
233
  - lib
@@ -242,8 +242,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
242
  - !ruby/object:Gem::Version
243
243
  version: '0'
244
244
  requirements: []
245
- rubygems_version: 3.5.10
246
- signing_key:
245
+ rubygems_version: 3.5.16
246
+ signing_key:
247
247
  specification_version: 4
248
248
  summary: Distribute tests over many workers using a queue
249
249
  test_files: []