sidekiq-status 1.1.3 → 1.1.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
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 852f99075106d76a18f3a0f21a3e49785069af7e8ee479c08959edeeef655439
|
4
|
+
data.tar.gz: 02fb95b39d1e37a081e64b2442a4c9a19b708d44bb52af24c1ccdff4d3a884c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7091b83f0ae9277478d75e6d5aab3a29936e76d0cb7c9f671031aa357e8fe2b4f1cacb92716fa3b5b2e474bbde3c5c26f8298195154d798f82d0f52a4e0661e7
|
7
|
+
data.tar.gz: 58c13e7c9fa8c1712bfbd47fbcb47a5cd69e0804093def9745de5d591d8dc1959e6701c6baff6efb808d305e7fe4f750859d5575f62b2d28f29484b6e2029f02
|
data/CHANGELOG.md
CHANGED
@@ -36,21 +36,39 @@ describe Sidekiq::Status::ServerMiddleware do
|
|
36
36
|
it "sets failed status when Exception raised" do
|
37
37
|
allow(SecureRandom).to receive(:hex).once.and_return(job_id)
|
38
38
|
start_server do
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
expect(capture_status_updates(3) {
|
40
|
+
expect(FailingHardJob.perform_async).to eq(job_id)
|
41
|
+
}).to eq([job_id]*3)
|
42
42
|
end
|
43
43
|
expect(redis.hget("sidekiq:status:#{job_id}", :status)).to eq('failed')
|
44
44
|
expect(Sidekiq::Status::failed?(job_id)).to be_truthy
|
45
45
|
end
|
46
46
|
|
47
|
+
context "when Sidekiq::Status::Worker is not included in the job" do
|
48
|
+
it "should not set a failed status" do
|
49
|
+
allow(SecureRandom).to receive(:hex).once.and_return(job_id)
|
50
|
+
start_server do
|
51
|
+
expect(FailingNoStatusJob.perform_async).to eq(job_id)
|
52
|
+
end
|
53
|
+
expect(redis.hget("sidekiq:status:#{job_id}", :status)).to be_nil
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should not set any status when Exception raised" do
|
57
|
+
allow(SecureRandom).to receive(:hex).once.and_return(job_id)
|
58
|
+
start_server do
|
59
|
+
expect(FailingHardNoStatusJob.perform_async).to eq(job_id)
|
60
|
+
end
|
61
|
+
expect(redis.hget("sidekiq:status:#{job_id}", :status)).to be_nil
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
47
65
|
context "sets interrupted status" do
|
48
66
|
it "on system exit signal" do
|
49
67
|
allow(SecureRandom).to receive(:hex).once.and_return(job_id)
|
50
68
|
start_server do
|
51
|
-
|
52
|
-
|
53
|
-
|
69
|
+
expect(capture_status_updates(3) {
|
70
|
+
expect(ExitedJob.perform_async).to eq(job_id)
|
71
|
+
}).to eq([job_id]*3)
|
54
72
|
end
|
55
73
|
expect(redis.hget("sidekiq:status:#{job_id}", :status)).to eq('interrupted')
|
56
74
|
expect(Sidekiq::Status::interrupted?(job_id)).to be_truthy
|
data/spec/support/test_jobs.rb
CHANGED
@@ -10,6 +10,16 @@ class StubJob
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
+
class StubNoStatusJob
|
14
|
+
include Sidekiq::Worker
|
15
|
+
|
16
|
+
sidekiq_options 'retry' => false
|
17
|
+
|
18
|
+
def perform(*args)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
|
13
23
|
class ExpiryJob < StubJob
|
14
24
|
def expiration
|
15
25
|
15
|
@@ -69,6 +79,12 @@ class FailingJob < StubJob
|
|
69
79
|
end
|
70
80
|
end
|
71
81
|
|
82
|
+
class FailingNoStatusJob < StubNoStatusJob
|
83
|
+
def perform
|
84
|
+
raise StandardError
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
72
88
|
class RetryAndFailJob < StubJob
|
73
89
|
sidekiq_options retry: 1
|
74
90
|
|
@@ -83,6 +99,12 @@ class FailingHardJob < StubJob
|
|
83
99
|
end
|
84
100
|
end
|
85
101
|
|
102
|
+
class FailingHardNoStatusJob < StubNoStatusJob
|
103
|
+
def perform
|
104
|
+
raise Exception
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
86
108
|
class ExitedJob < StubJob
|
87
109
|
def perform
|
88
110
|
raise SystemExit
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-status
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeniy Tsvigun
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-06-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sidekiq
|