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

Commit 8d1e1bf

Browse files
committed
v3: Run usage event-purging specs in isolation: truncation mode
When we added these tests recently, we started seeing lots of random other failures in CI when run against MySQL. It seemed to be a test pollution issue (other tests were seeing DB entries they didn't expect, or were missing DB entries that they did expect). After talking to the CAPI team, we learned that the table truncation performed by these new endpoints may change the mode that tests are run in. Usually, they are run in a transaction that gets rolled back automatically, so we avoid pollution. But this truncation may change that. To fix it, we are attempting here to run these new truncating tests with `isolation: :truncation`, to keep them better isolated and avoid test pollution. Authored-by: Reid Mitchell <rmitchell@pivotal.io>
1 parent 51b0fd7 commit 8d1e1bf

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

spec/request/app_usage_events_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
end
118118
end
119119

120-
describe 'POST /v3/app_usage_events/actions/destructively_purge_all_and_reseed' do
120+
describe 'POST /v3/app_usage_events/actions/destructively_purge_all_and_reseed', isolation: :truncation do
121121
let(:api_call) { lambda { |user_headers| post '/v3/app_usage_events/actions/destructively_purge_all_and_reseed', nil, user_headers } }
122122
let(:app_model) { VCAP::CloudController::AppModel.make(space: space) }
123123

spec/request/service_usage_events_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
end
149149
end
150150

151-
describe 'POST /v3/service_usage_events/actions/destructively_purge_all_and_reseed' do
151+
describe 'POST /v3/service_usage_events/actions/destructively_purge_all_and_reseed', isolation: :truncation do
152152
let(:api_call) { lambda { |user_headers| post '/v3/service_usage_events/actions/destructively_purge_all_and_reseed', nil, user_headers } }
153153

154154
let!(:service_instance) do

0 commit comments

Comments
 (0)