Skip to content

Commit

Permalink
Merge pull request #138 from kongslund/request-timeout
Browse files Browse the repository at this point in the history
Increase WEBrick request timeout to 300 seconds. Fixes #137
  • Loading branch information
thommay authored Jul 19, 2016
2 parents 143edc9 + e18dac6 commit 1b1bc10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/chef_zero/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ def start_background(wait = 5)
:DoNotListen => true,
:AccessLog => [],
:Logger => WEBrick::Log.new(StringIO.new, 7),
:RequestTimeout => 300,
:SSLEnable => options[:ssl],
:SSLOptions => ssl_opts,
:SSLCertName => [ [ 'CN', WEBrick::Utils::getservername ] ],
Expand Down
4 changes: 4 additions & 0 deletions spec/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
expect { ChefZero::Server.new(:port => 8889.upto(8889)).start_background }.to raise_error Errno::EADDRINUSE
end

it 'has a very patient request timeout' do
expect(@server.server.config[:RequestTimeout]).to eq 300
end

context 'accept headers' do
def get_nodes(accepts)
uri = URI(@server.url)
Expand Down

0 comments on commit 1b1bc10

Please sign in to comment.