sidekiq-failures 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +5 -5
- data/lib/sidekiq/failures/middleware.rb +1 -1
- data/lib/sidekiq/failures/version.rb +1 -1
- data/test/middleware_test.rb +32 -4
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sidekiq-failures (0.2.
|
4
|
+
sidekiq-failures (0.2.1)
|
5
5
|
sidekiq (>= 2.2.1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
celluloid (0.14.
|
10
|
+
celluloid (0.14.1)
|
11
11
|
timers (>= 1.0.0)
|
12
|
-
connection_pool (1.
|
12
|
+
connection_pool (1.1.0)
|
13
13
|
hike (1.2.1)
|
14
14
|
json (1.8.0)
|
15
15
|
multi_json (1.7.3)
|
@@ -22,8 +22,8 @@ GEM
|
|
22
22
|
redis (3.0.4)
|
23
23
|
redis-namespace (1.3.0)
|
24
24
|
redis (~> 3.0.0)
|
25
|
-
sidekiq (2.12.
|
26
|
-
celluloid (>= 0.14.
|
25
|
+
sidekiq (2.12.4)
|
26
|
+
celluloid (>= 0.14.1)
|
27
27
|
connection_pool (>= 1.0.0)
|
28
28
|
json
|
29
29
|
redis (>= 3.0)
|
data/test/middleware_test.rb
CHANGED
@@ -93,7 +93,7 @@ module Sidekiq
|
|
93
93
|
it "doesn't record failure if going to be retired again and configured to track exhaustion by default" do
|
94
94
|
Sidekiq.failures_default_mode = :exhausted
|
95
95
|
|
96
|
-
msg = create_work('class' => MockWorker.to_s, 'args' => ['myarg'] )
|
96
|
+
msg = create_work('class' => MockWorker.to_s, 'args' => ['myarg'], 'retry' => true )
|
97
97
|
|
98
98
|
assert_equal 0, failures_count
|
99
99
|
|
@@ -107,7 +107,7 @@ module Sidekiq
|
|
107
107
|
|
108
108
|
|
109
109
|
it "doesn't record failure if going to be retired again and configured to track exhaustion" do
|
110
|
-
msg = create_work('class' => MockWorker.to_s, 'args' => ['myarg'], 'failures' => 'exhausted')
|
110
|
+
msg = create_work('class' => MockWorker.to_s, 'args' => ['myarg'], 'retry' => true, 'failures' => 'exhausted')
|
111
111
|
|
112
112
|
assert_equal 0, failures_count
|
113
113
|
|
@@ -120,7 +120,35 @@ module Sidekiq
|
|
120
120
|
end
|
121
121
|
|
122
122
|
it "records failure if failing last retry and configured to track exhaustion" do
|
123
|
-
msg = create_work('class' => MockWorker.to_s, 'args' => ['myarg'], 'retry_count' => 24, 'failures' => 'exhausted')
|
123
|
+
msg = create_work('class' => MockWorker.to_s, 'args' => ['myarg'], 'retry' => true, 'retry_count' => 24, 'failures' => 'exhausted')
|
124
|
+
|
125
|
+
assert_equal 0, failures_count
|
126
|
+
|
127
|
+
assert_raises TestException do
|
128
|
+
@processor.process(msg)
|
129
|
+
end
|
130
|
+
|
131
|
+
assert_equal 1, failures_count
|
132
|
+
assert_equal 1, $invokes
|
133
|
+
end
|
134
|
+
|
135
|
+
it "records failure if retry disabled and configured to track exhaustion" do
|
136
|
+
msg = create_work('class' => MockWorker.to_s, 'args' => ['myarg'], 'retry' => false, 'failures' => 'exhausted')
|
137
|
+
|
138
|
+
assert_equal 0, failures_count
|
139
|
+
|
140
|
+
assert_raises TestException do
|
141
|
+
@processor.process(msg)
|
142
|
+
end
|
143
|
+
|
144
|
+
assert_equal 1, failures_count
|
145
|
+
assert_equal 1, $invokes
|
146
|
+
end
|
147
|
+
|
148
|
+
it "records failure if retry disabled and configured to track exhaustion by default" do
|
149
|
+
Sidekiq.failures_default_mode = 'exhausted'
|
150
|
+
|
151
|
+
msg = create_work('class' => MockWorker.to_s, 'args' => ['myarg'], 'retry' => false)
|
124
152
|
|
125
153
|
assert_equal 0, failures_count
|
126
154
|
|
@@ -135,7 +163,7 @@ module Sidekiq
|
|
135
163
|
it "records failure if failing last retry and configured to track exhaustion by default" do
|
136
164
|
Sidekiq.failures_default_mode = 'exhausted'
|
137
165
|
|
138
|
-
msg = create_work('class' => MockWorker.to_s, 'args' => ['myarg'], 'retry_count' => 24)
|
166
|
+
msg = create_work('class' => MockWorker.to_s, 'args' => ['myarg'], 'retry' => true, 'retry_count' => 24)
|
139
167
|
|
140
168
|
assert_equal 0, failures_count
|
141
169
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-failures
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sidekiq
|
@@ -145,7 +145,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
segments:
|
147
147
|
- 0
|
148
|
-
hash: -
|
148
|
+
hash: -2579273263044937702
|
149
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
150
|
none: false
|
151
151
|
requirements:
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '0'
|
155
155
|
segments:
|
156
156
|
- 0
|
157
|
-
hash: -
|
157
|
+
hash: -2579273263044937702
|
158
158
|
requirements: []
|
159
159
|
rubyforge_project:
|
160
160
|
rubygems_version: 1.8.23
|