1
0
Fork 0
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:
Paul Thornthwaite 2014-02-19 10:06:00 +00:00
commit 6823462a5d
3 changed files with 13 additions and 10 deletions

View file

@ -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

View file

@ -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

View file

@ -5,17 +5,11 @@ 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)
end
def given_a_load_balancer(&block)
@lb = @service.load_balancers.create({
:name => ('fog' + Time.now.to_i.to_s),
@ -32,7 +26,7 @@ module Shindo
@lb.destroy
end
end
def wait_for_request(description = "waiting", &block)
return if Fog.mocking?
tests(description) do
@ -96,4 +90,4 @@ module Shindo
return true
end
end
end
end