Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit 81059ef

Browse files
committed
v3: Make service usage events spec less flaky
These tests would occasionally fail in CI when they ran in a certain order. Tests were adding events to the database that other tests weren't expecting to be there. Now, we make sure to clean up after the newly-added test. Similar to b15d26c Authored-by: Reid Mitchell <rmitchell@pivotal.io>
1 parent 467611b commit 81059ef

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

spec/request/service_usage_events_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@
165165
h.freeze
166166
end
167167

168+
after 'clean-up to avoid test pollution' do
169+
VCAP::CloudController::ServiceUsageEvent.all.first.delete
170+
end
171+
168172
it_behaves_like 'permissions for single object endpoint', ALL_PERMISSIONS do
169173
let(:after_request_check) do
170174
lambda do

0 commit comments

Comments
 (0)