ci-queue 0.20.6 → 0.20.7

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: fdf8ce628f8d7b21a66f614c867dbd2f568b011f22a467a6d274c51e81294a63
4
- data.tar.gz: c591e50cf510e91d6aa6d6bbf39573b38581002c2dcf2e07f1b57e9edb2abef6
3
+ metadata.gz: 869f4269443defdf645936cf4b6cf969dd821263b9a96b4de71da7bbbbd98152
4
+ data.tar.gz: 3aa8a19f472ed869a88f35b3c124a01700fc1acf235617c5f78dcb67232f91c8
5
5
  SHA512:
6
- metadata.gz: 9b5b2c9fe39aa132bda26cc98387349eaddcfb2074e37ed225f675a3e8fb3c50f42dab761f0620b54d1df48ae285b10d75f1b66f07456e05d4bccbfb01116414
7
- data.tar.gz: f92b07076fc21b13efe3a9587f4e57cf7d1d12b1838c37d10fcbeb8b2e4e684a101fd5d9588fa482e06cf45c0e12f1bce212b5d7e9bcf695e4ba8f5fcfdd7864
6
+ metadata.gz: 7d5cd85fe45b05060738a72f6be624e3cfef6bf9a24ea3019433773aa7bb8a7a6f5ef94dc6a0d2cce5a2d04d4b820ca242f41f07e8720aa2f004f528bc4de372
7
+ data.tar.gz: a82a023c73718e924210c2a379d6195b62062731679c24c6a230cff26df3d455107c1a902d8a9a97fd3a2a2510a6c145e8f02545121720139ad2e2802d37b3ae
@@ -8,6 +8,7 @@ module CI
8
8
  attr_accessor :max_test_failed
9
9
  attr_reader :circuit_breakers
10
10
  attr_writer :seed, :build_id
11
+ attr_writer :queue_init_timeout
11
12
 
12
13
  class << self
13
14
  def from_env(env)
@@ -32,7 +33,8 @@ module CI
32
33
  timeout: 30, build_id: nil, worker_id: nil, max_requeues: 0, requeue_tolerance: 0,
33
34
  namespace: nil, seed: nil, flaky_tests: [], statsd_endpoint: nil, max_consecutive_failures: nil,
34
35
  grind_count: nil, max_duration: nil, failure_file: nil, max_test_duration: nil,
35
- max_test_duration_percentile: 0.5, track_test_duration: false, max_test_failed: nil
36
+ max_test_duration_percentile: 0.5, track_test_duration: false, max_test_failed: nil,
37
+ queue_init_timeout: nil
36
38
  )
37
39
  @build_id = build_id
38
40
  @circuit_breakers = [CircuitBreaker::Disabled]
@@ -48,12 +50,17 @@ module CI
48
50
  @seed = seed
49
51
  @statsd_endpoint = statsd_endpoint
50
52
  @timeout = timeout
53
+ @queue_init_timeout = queue_init_timeout
51
54
  @track_test_duration = track_test_duration
52
55
  @worker_id = worker_id
53
56
  self.max_consecutive_failures = max_consecutive_failures
54
57
  self.max_duration = max_duration
55
58
  end
56
59
 
60
+ def queue_init_timeout
61
+ @queue_init_timeout || timeout
62
+ end
63
+
57
64
  def max_consecutive_failures=(max)
58
65
  if max
59
66
  @circuit_breakers << CircuitBreaker::MaxConsecutiveFailures.new(max_consecutive_failures: max)
@@ -8,7 +8,7 @@ module CI
8
8
  end
9
9
 
10
10
  def total
11
- wait_for_master(timeout: config.timeout)
11
+ wait_for_master(timeout: config.queue_init_timeout)
12
12
  redis.get(key('total')).to_i
13
13
  end
14
14
 
@@ -17,7 +17,7 @@ module CI
17
17
  end
18
18
 
19
19
  def wait_for_workers
20
- return false unless wait_for_master(timeout: config.timeout)
20
+ wait_for_master(timeout: config.queue_init_timeout)
21
21
 
22
22
  yield if block_given?
23
23
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CI
4
4
  module Queue
5
- VERSION = '0.20.6'
5
+ VERSION = '0.20.7'
6
6
  DEV_SCRIPTS_ROOT = ::File.expand_path('../../../../../redis', __FILE__)
7
7
  RELEASE_SCRIPTS_ROOT = ::File.expand_path('../redis', __FILE__)
8
8
  end
@@ -352,7 +352,7 @@ module Minitest
352
352
 
353
353
  help = <<~EOS
354
354
  Specify a timeout after which if a test haven't completed, it will be picked up by another worker.
355
- It is very important to set this vlaue higher than the slowest test in the suite, otherwise performance will be impacted.
355
+ It is very important to set this value higher than the slowest test in the suite, otherwise performance will be impacted.
356
356
  Defaults to 30 seconds.
357
357
  EOS
358
358
  opts.separator ""
@@ -360,6 +360,15 @@ module Minitest
360
360
  queue_config.timeout = timeout
361
361
  end
362
362
 
363
+ help = <<~EOS
364
+ Specify a timeout to elect the leader and populate the queue.
365
+ Defaults to the value set for --timeout.
366
+ EOS
367
+ opts.separator ""
368
+ opts.on('--queue-init-timeout TIMEOUT', Float, help) do |timeout|
369
+ queue_config.queue_init_timeout = timeout
370
+ end
371
+
363
372
  help = <<~EOS
364
373
  Specify $LOAD_PATH directory, similar to Ruby's -I
365
374
  EOS
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.20.6
4
+ version: 0.20.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-23 00:00:00.000000000 Z
11
+ date: 2020-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler