Skip to content

Commit

Permalink
Don't blow up lifecycle tests if an instance we're trying to delete i…
Browse files Browse the repository at this point in the history
…s gone
  • Loading branch information
Caleb Miles committed Mar 23, 2016
1 parent 1540e81 commit 7d7dd89
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/bosh_aws_cpi/spec/integration/lifecycle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@
end

before do
AWS::EC2.new(
access_key_id: @access_key_id,
secret_access_key: @secret_access_key,
).instances.tagged('delete_me').each(&:terminate)
begin
AWS::EC2.new(
access_key_id: @access_key_id,
secret_access_key: @secret_access_key,
).instances.tagged('delete_me').each(&:terminate)
rescue AWS::EC2::Errors::InvalidInstanceID::NotFound
# don't blow up tests if instance that we're trying to delete was not found
end
end

before { allow(Bosh::Clouds::Config).to receive_messages(logger: logger) }
Expand Down

0 comments on commit 7d7dd89

Please sign in to comment.