mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #2690 from fog/make_timeout_change_global
[core] Make the wait timeout truly global
This commit is contained in:
commit
6823462a5d
3 changed files with 13 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
Shindo.tests('Fog#timeout', 'core') do
|
||||
tests('timeout').returns(600) do
|
||||
tests('timeout').returns(FOG_TESTING_TIMEOUT) do
|
||||
Fog.timeout
|
||||
end
|
||||
|
||||
|
|
|
@ -21,6 +21,15 @@ Excon.defaults.merge!(:debug_request => true, :debug_response => true)
|
|||
|
||||
require File.expand_path(File.join(File.dirname(__FILE__), 'helpers', 'mock_helper'))
|
||||
|
||||
# This overrides the default 600 seconds timeout during live test runs
|
||||
if Fog.mocking?
|
||||
FOG_TESTING_TIMEOUT = ENV['FOG_TEST_TIMEOUT'] || 2000
|
||||
Fog.timeout = 2000
|
||||
Fog::Logger.warning "Setting default fog timeout to #{Fog.timeout} seconds"
|
||||
else
|
||||
FOG_TESTING_TIMEOUT = Fog.timeout
|
||||
end
|
||||
|
||||
def lorem_file
|
||||
File.open(File.dirname(__FILE__) + '/lorem.txt', 'r')
|
||||
end
|
||||
|
|
|
@ -5,12 +5,6 @@ LINKS_FORMAT = [{
|
|||
|
||||
module Shindo
|
||||
class Tests
|
||||
|
||||
unless Fog.mocking?
|
||||
Fog.timeout = 2000
|
||||
Fog::Logger.warning "Setting default fog timeout to #{Fog.timeout} seconds"
|
||||
end
|
||||
|
||||
def given_a_load_balancer_service(&block)
|
||||
@service = Fog::Rackspace::LoadBalancers.new
|
||||
instance_eval(&block)
|
||||
|
|
Loading…
Add table
Reference in a new issue