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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ff5e0f88a008abb13c1ca010f4b430be290ecf4e349719cac39611eebc575a4
4
- data.tar.gz: 83650913e5d6cd21201ebce5ae48c731d61a0bc27bb37f566fcdc3d96a9b0598
3
+ metadata.gz: e71ab6f3ce5b553af4903e555e1d44cdaa5d3f5e6a6e27a67a0f651546f3c979
4
+ data.tar.gz: bc4cc3f898e1e02ffec511a62163b66659239ad4ecc2f2bdd0a0043dc2bdf478
5
5
  SHA512:
6
- metadata.gz: 3b3d2dc24c6592040f559f77f59168502bb949b135406a06f59c836494902412e202a28bc781760e0862f416ccaa2d2c9a246269fee87e9fd3d9120ba803f4ab
7
- data.tar.gz: 9d4005922f963d765b494ab2b35642fa3be85787a6deb8b490ed3e1f64e5055d474d4cdae5b1bba4d4668b4c63fd59d9063102baf7036830e53d409ba8cf016a
6
+ metadata.gz: c54c2b2c4d0a0a72625d3abc3fbc1d9123de22ca13cb2e409e372a5a7e818ce13399adc64f2a65c88bf1351de6b82834753b6633e953f79c498ef2c07a9979ec
7
+ data.tar.gz: 9886473b35736ee93aa08adf71202e83b21be27cfa82defa98478dd01ee8fadd503d27064fe1ac1b916ef218c4b828dc01f457523e14d8b1b26c26856727e06c
@@ -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
- Kernel.sleep(wait)
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
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '1.22.1'
2
+ VERSION = '1.22.2'
3
3
  end
@@ -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(Kernel).to receive(:sleep).with(8)
92
- expect(Kernel).to receive(:sleep).with(16)
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
- expect(Kernel).to receive(:sleep).with(8)
123
- expect(Kernel).to receive(:sleep).with(16)
124
- expect(Kernel).to receive(:sleep).with(24)
125
- expect(Kernel).to receive(:sleep).with(32)
126
- expect(Kernel).to receive(:sleep).with(40)
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.1
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-05-31 00:00:00.000000000 Z
11
+ date: 2020-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake