knapsack_pro 1.22.1 → 1.22.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/knapsack_pro/client/connection.rb +5 -1
- data/lib/knapsack_pro/version.rb +1 -1
- data/spec/knapsack_pro/client/connection_spec.rb +40 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e71ab6f3ce5b553af4903e555e1d44cdaa5d3f5e6a6e27a67a0f651546f3c979
|
4
|
+
data.tar.gz: bc4cc3f898e1e02ffec511a62163b66659239ad4ecc2f2bdd0a0043dc2bdf478
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c54c2b2c4d0a0a72625d3abc3fbc1d9123de22ca13cb2e409e372a5a7e818ce13399adc64f2a65c88bf1351de6b82834753b6633e953f79c498ef2c07a9979ec
|
7
|
+
data.tar.gz: 9886473b35736ee93aa08adf71202e83b21be27cfa82defa98478dd01ee8fadd503d27064fe1ac1b916ef218c4b828dc01f457523e14d8b1b26c26856727e06c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
### 1.22.2
|
4
|
+
|
5
|
+
* Log when next retry request to Knapsack Pro API happens before starting Fallback Mode
|
6
|
+
|
7
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/114
|
8
|
+
|
9
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v1.22.1...v1.22.2
|
10
|
+
|
3
11
|
### 1.22.1
|
4
12
|
|
5
13
|
* Fix for an auto split of slow RSpec test files by test examples when using `KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES=true` and `parallel_tests` gem. Save the JSON reports with unique file names with the CI node index in the name to avoid accidentally overriding the files on the same disk.
|
@@ -121,7 +121,11 @@ module KnapsackPro
|
|
121
121
|
if retries < MAX_RETRY.call
|
122
122
|
wait = retries * REQUEST_RETRY_TIMEBOX
|
123
123
|
logger.warn("Wait #{wait}s and retry request to Knapsack Pro API.")
|
124
|
-
|
124
|
+
print_every = 2 # seconds
|
125
|
+
(wait / print_every).ceil.times do |i|
|
126
|
+
logger.warn("Next request in #{wait - i * print_every}s...")
|
127
|
+
Kernel.sleep(print_every)
|
128
|
+
end
|
125
129
|
retry
|
126
130
|
else
|
127
131
|
response_body
|
data/lib/knapsack_pro/version.rb
CHANGED
@@ -87,9 +87,20 @@ shared_examples 'when retry request' do
|
|
87
87
|
expect(logger).to receive(:warn).exactly(3).with(server_error.inspect)
|
88
88
|
|
89
89
|
expect(logger).to receive(:warn).with("Wait 8s and retry request to Knapsack Pro API.")
|
90
|
+
expect(logger).to receive(:warn).with("Next request in 8s...")
|
91
|
+
expect(logger).to receive(:warn).with("Next request in 6s...")
|
92
|
+
expect(logger).to receive(:warn).with("Next request in 4s...")
|
93
|
+
expect(logger).to receive(:warn).with("Next request in 2s...")
|
90
94
|
expect(logger).to receive(:warn).with("Wait 16s and retry request to Knapsack Pro API.")
|
91
|
-
expect(
|
92
|
-
expect(
|
95
|
+
expect(logger).to receive(:warn).with("Next request in 16s...")
|
96
|
+
expect(logger).to receive(:warn).with("Next request in 14s...")
|
97
|
+
expect(logger).to receive(:warn).with("Next request in 12s...")
|
98
|
+
expect(logger).to receive(:warn).with("Next request in 10s...")
|
99
|
+
expect(logger).to receive(:warn).with("Next request in 8s...")
|
100
|
+
expect(logger).to receive(:warn).with("Next request in 6s...")
|
101
|
+
expect(logger).to receive(:warn).with("Next request in 4s...")
|
102
|
+
expect(logger).to receive(:warn).with("Next request in 2s...")
|
103
|
+
expect(Kernel).to receive(:sleep).exactly(12).with(2)
|
93
104
|
|
94
105
|
expect(subject).to eq(parsed_response)
|
95
106
|
|
@@ -115,15 +126,37 @@ shared_examples 'when retry request' do
|
|
115
126
|
expect(logger).to receive(:warn).exactly(6).with(server_error.inspect)
|
116
127
|
|
117
128
|
expect(logger).to receive(:warn).with("Wait 8s and retry request to Knapsack Pro API.")
|
129
|
+
expect(logger).to receive(:warn).with("Next request in 8s...")
|
130
|
+
expect(logger).to receive(:warn).with("Next request in 6s...")
|
131
|
+
expect(logger).to receive(:warn).with("Next request in 4s...")
|
132
|
+
expect(logger).to receive(:warn).with("Next request in 2s...")
|
133
|
+
|
118
134
|
expect(logger).to receive(:warn).with("Wait 16s and retry request to Knapsack Pro API.")
|
135
|
+
expect(logger).to receive(:warn).with("Next request in 16s...")
|
136
|
+
expect(logger).to receive(:warn).with("Next request in 14s...")
|
137
|
+
expect(logger).to receive(:warn).with("Next request in 12s...")
|
138
|
+
expect(logger).to receive(:warn).with("Next request in 10s...")
|
139
|
+
expect(logger).to receive(:warn).with("Next request in 8s...")
|
140
|
+
expect(logger).to receive(:warn).with("Next request in 6s...")
|
141
|
+
expect(logger).to receive(:warn).with("Next request in 4s...")
|
142
|
+
expect(logger).to receive(:warn).with("Next request in 2s...")
|
143
|
+
|
119
144
|
expect(logger).to receive(:warn).with("Wait 24s and retry request to Knapsack Pro API.")
|
145
|
+
12.times do |i|
|
146
|
+
expect(logger).to receive(:warn).with("Next request in #{(i+1)*2}s...")
|
147
|
+
end
|
148
|
+
|
120
149
|
expect(logger).to receive(:warn).with("Wait 32s and retry request to Knapsack Pro API.")
|
150
|
+
16.times do |i|
|
151
|
+
expect(logger).to receive(:warn).with("Next request in #{(i+1)*2}s...")
|
152
|
+
end
|
153
|
+
|
121
154
|
expect(logger).to receive(:warn).with("Wait 40s and retry request to Knapsack Pro API.")
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
expect(Kernel).to receive(:sleep).with(
|
155
|
+
20.times do |i|
|
156
|
+
expect(logger).to receive(:warn).with("Next request in #{(i+1)*2}s...")
|
157
|
+
end
|
158
|
+
|
159
|
+
expect(Kernel).to receive(:sleep).exactly(60).with(2)
|
127
160
|
|
128
161
|
expect(subject).to eq(parsed_response)
|
129
162
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knapsack_pro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.22.
|
4
|
+
version: 1.22.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|