require 'bundler/setup'
require 'machete'
require 'machete/matchers'

`mkdir -p log`
Machete.logger = Machete::Logger.new("log/integration.log")

RSpec.configure do |config|
  config.color = true
  config.tty = true

  config.filter_run_excluding :cached => ENV['BUILDPACK_MODE'] == 'uncached'
  config.filter_run_excluding :uncached => ENV['BUILDPACK_MODE'] == 'cached'
end

require 'bundler/setup'
require 'machete'
require 'machete/matchers'
require 'timeout'

`mkdir -p log`
Machete.logger = Machete::Logger.new("log/integration.log")

RSpec.configure do |config|
  config.color = true
  config.tty = true

  config.filter_run_excluding :cached => ENV['BUILDPACK_MODE'] == 'uncached'
  config.filter_run_excluding :uncached => ENV['BUILDPACK_MODE'] == 'cached'

  config.around(:each) do |example|
    allowed_time = 20 * 60 # 20 minutes per attempt
    begin
      Timeout::timeout(allowed_time) do
        example.run
      end
    rescue Timeout::Error
      RSpec.configuration.reporter.message("Retry try #{example.location}")

      Timeout::timeout(allowed_time) do
        example.run
      end
    end
  end
end

Add timeout to integration tests and retry on timeout
Add timeout to integration tests and retry on timeout

[#138839265]

Signed-off-by: Dave Goddard <bfcdf3e6ca6cef45543bfbb57509c92aec9a39fb@goddard.id.au>
Signed-off-by: Anna Thornton <0e9b4a17e1cf85a71a11118ecdbc866e5f8ffc65@pivotal.io>
