Skip to content

Commit

Permalink
Set timeout to 15s because it will slow down CI build by ~2 minutes w…
Browse files Browse the repository at this point in the history
…hen we retry requests 3 times in case of Queue Mode when the Knapsack Pro API will hang infinitely. This is the most pessimistic scenario.
  • Loading branch information
ArturT committed Aug 15, 2017
1 parent 7dda679 commit 7196ff6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/knapsack_pro/client/connection.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module KnapsackPro
module Client
class Connection
TIMEOUT = 30
TIMEOUT = 15
REQUEST_RETRY_TIMEBOX = 2

def initialize(action)
Expand Down
4 changes: 2 additions & 2 deletions spec/knapsack_pro/client/connection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
expect(Net::HTTP).to receive(:new).with('api.knapsackpro.dev', 3000).and_return(http)

expect(http).to receive(:use_ssl=).with(false)
expect(http).to receive(:open_timeout=).with(30)
expect(http).to receive(:read_timeout=).with(30)
expect(http).to receive(:open_timeout=).with(15)
expect(http).to receive(:read_timeout=).with(15)

header = { 'X-Request-Id' => 'fake-uuid' }
http_response = instance_double(Net::HTTPOK, body: body, header: header)
Expand Down

0 comments on commit 7196ff6

Please sign in to comment.