ci-queue 0.13.3 → 0.13.4

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
- SHA256:
3
- metadata.gz: 382aec3675b3ce7db16188d59a277916634e3c84779faedd79c1a3c89ef89d17
4
- data.tar.gz: a62b3004eec89334191a8c1086bb95cab2b6c6abfc5305a18ac44cbb6b7f34d9
2
+ SHA1:
3
+ metadata.gz: d91fd02d29e5c4502c858d46890cdd17f8dd80f1
4
+ data.tar.gz: a9aff819b8b7d5c471f7100fd27317492224442b
5
5
  SHA512:
6
- metadata.gz: d53bdaf3c81a5046b5cf583206d189433a8f4977c60f67cdf0bbdfeb0d95f39b1ac37629ce15c6c603d07f108288bf63fa5c5280301ce307584fc2ba09eee494
7
- data.tar.gz: e881fd1040688d7bfcfe88ffbfb63f87af067347d61da653a7caa8e6dcbead2660751264bb1be7dc5687d964d926a2c6dace6422026d3060f997de8850618313
6
+ metadata.gz: c45c433780015c85763148708db522f47a41891fe02782bd7b5cdd05c8edc7e9ea9b5f4b4af45efc43a1f866bb753432040a78fa76d0383dce6120258ceab90a
7
+ data.tar.gz: 79684e26a534c56048d40c4ab0bd9d7efb9ef7149fb53e2746760f4c74eb2eb7b3baa9ed409a7198b98afb975be81319de0b4e6d70e790409216e79ef912daab
@@ -3,6 +3,9 @@ module CI
3
3
  module Common
4
4
  attr_reader :config
5
5
 
6
+ # to override in classes including this module
7
+ CONNECTION_ERRORS = [].freeze
8
+
6
9
  def flaky?(test)
7
10
  @config.flaky?(test)
8
11
  end
@@ -14,6 +17,12 @@ module CI
14
17
  def report_success!
15
18
  config.circuit_breaker.report_success!
16
19
  end
20
+
21
+ def rescue_connection_errors(handler = ->(err) { nil })
22
+ yield
23
+ rescue *self::class::CONNECTION_ERRORS => err
24
+ handler.call(err)
25
+ end
17
26
  end
18
27
  end
19
28
  end
@@ -4,6 +4,11 @@ module CI
4
4
  class Base
5
5
  include Common
6
6
 
7
+ CONNECTION_ERRORS = [
8
+ ::Redis::BaseConnectionError,
9
+ ::SocketError, # https://github.com/redis/redis-rb/pull/631
10
+ ].freeze
11
+
7
12
  def initialize(redis_url, config)
8
13
  @redis_url = redis_url
9
14
  @redis = ::Redis.new(url: redis_url)
@@ -3,11 +3,6 @@ require 'ci/queue/static'
3
3
  module CI
4
4
  module Queue
5
5
  module Redis
6
- CONNECTION_ERRORS = [
7
- ::Redis::BaseConnectionError,
8
- ::SocketError, # https://github.com/redis/redis-rb/pull/631
9
- ].freeze
10
-
11
6
  ReservationError = Class.new(StandardError)
12
7
 
13
8
  class << self
@@ -50,7 +50,6 @@ module CI
50
50
  def poll
51
51
  while !config.circuit_breaker.open? && test = @queue.shift
52
52
  yield index.fetch(test)
53
- @progress += 1
54
53
  end
55
54
  end
56
55
 
@@ -59,6 +58,7 @@ module CI
59
58
  end
60
59
 
61
60
  def acknowledge(test)
61
+ @progress += 1
62
62
  true
63
63
  end
64
64
 
@@ -1,6 +1,6 @@
1
1
  module CI
2
2
  module Queue
3
- VERSION = '0.13.3'
3
+ VERSION = '0.13.4'
4
4
  DEV_SCRIPTS_ROOT = ::File.expand_path('../../../../../redis', __FILE__)
5
5
  RELEASE_SCRIPTS_ROOT = ::File.expand_path('../redis', __FILE__)
6
6
  end
@@ -57,8 +57,11 @@ module Minitest
57
57
 
58
58
  trap('TERM') { Minitest.queue.shutdown! }
59
59
  trap('INT') { Minitest.queue.shutdown! }
60
- load_tests
61
- populate_queue
60
+
61
+ unless queue.rescue_connection_errors { queue.exhausted? }
62
+ load_tests
63
+ populate_queue
64
+ end
62
65
  # Let minitest's at_exit hook trigger
63
66
  end
64
67
 
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.13.3
4
+ version: 0.13.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-30 00:00:00.000000000 Z
11
+ date: 2018-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
226
  version: '0'
227
227
  requirements: []
228
228
  rubyforge_project:
229
- rubygems_version: 2.7.6
229
+ rubygems_version: 2.6.14
230
230
  signing_key:
231
231
  specification_version: 4
232
232
  summary: Distribute tests over many workers using a queue