Commit 7477d032 authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-flaky-spec-stop-environments-service' into 'master'

Fix order dependent failure on stop_environments_service_spec

Closes #205630

See merge request gitlab-org/gitlab!25290
parents 90fd52b0 d04122e3
......@@ -217,18 +217,20 @@ describe Ci::StopEnvironmentsService do
context 'when user does not have a permission to play the stop action' do
before do
Ci::Build.find_by_ref('review/feature-2').update_column(:user_id, nil)
project.team.truncate
end
it 'tracks the exception' do
deployable = Ci::Build.find_by_ref('review/feature-2')
expect(Gitlab::ErrorTracking)
.to receive(:track_error)
.with(Gitlab::Access::AccessDeniedError, deployable_id: deployable.id).once
.with(Gitlab::Access::AccessDeniedError, anything).twice
subject
end
after do
project.add_developer(user)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment