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 +5 -5
- data/lib/ci/queue/common.rb +9 -0
- data/lib/ci/queue/redis/base.rb +5 -0
- data/lib/ci/queue/redis/worker.rb +0 -5
- data/lib/ci/queue/static.rb +1 -1
- data/lib/ci/queue/version.rb +1 -1
- data/lib/minitest/queue/runner.rb +5 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d91fd02d29e5c4502c858d46890cdd17f8dd80f1
|
4
|
+
data.tar.gz: a9aff819b8b7d5c471f7100fd27317492224442b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c45c433780015c85763148708db522f47a41891fe02782bd7b5cdd05c8edc7e9ea9b5f4b4af45efc43a1f866bb753432040a78fa76d0383dce6120258ceab90a
|
7
|
+
data.tar.gz: 79684e26a534c56048d40c4ab0bd9d7efb9ef7149fb53e2746760f4c74eb2eb7b3baa9ed409a7198b98afb975be81319de0b4e6d70e790409216e79ef912daab
|
data/lib/ci/queue/common.rb
CHANGED
@@ -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
|
data/lib/ci/queue/redis/base.rb
CHANGED
@@ -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
|
data/lib/ci/queue/static.rb
CHANGED
@@ -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
|
|
data/lib/ci/queue/version.rb
CHANGED
@@ -57,8 +57,11 @@ module Minitest
|
|
57
57
|
|
58
58
|
trap('TERM') { Minitest.queue.shutdown! }
|
59
59
|
trap('INT') { Minitest.queue.shutdown! }
|
60
|
-
|
61
|
-
|
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.
|
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-
|
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.
|
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
|