Commit 1d4f310d authored by Stan Hu's avatar Stan Hu

Potential workaround for flaky spec in jobs_controller_spec.rb

`ee/spec/controllers/ee/projects/jobs_controller_spec.rb` appears to be
flaky due to some intermittent issue with handling a `GRPC::NotFound`
exception in a streaming response. Even the debugger has difficult
following the flow:
https://github.com/deivid-rodriguez/byebug/issues/725

The controller is attempting to lookup the ref of the pipeline
commit. In the common case, repository would be there, and rendering a
pipeline from a missing repository isn't normal. We work around the
issue by just making sure the projects in the test have repositories.

Potential fix for https://gitlab.com/gitlab-org/gitlab/-/issues/227845
parent 1c72c599
......@@ -21,7 +21,7 @@ RSpec.describe Projects::JobsController do
end
context 'with shared runner that has quota' do
let(:project) { create(:project, :private, shared_runners_enabled: true) }
let(:project) { create(:project, :repository, :private, shared_runners_enabled: true) }
before do
stub_application_setting(shared_runners_minutes: 2)
......@@ -54,7 +54,7 @@ RSpec.describe Projects::JobsController do
end
context 'when shared runner has no quota' do
let(:project) { create(:project, :private, shared_runners_enabled: true) }
let(:project) { create(:project, :repository, :private, shared_runners_enabled: true) }
before do
stub_application_setting(shared_runners_minutes: 0)
......@@ -70,7 +70,7 @@ RSpec.describe Projects::JobsController do
end
context 'when project is public' do
let(:project) { create(:project, :public, shared_runners_enabled: true) }
let(:project) { create(:project, :repository, :public, shared_runners_enabled: true) }
before do
stub_application_setting(shared_runners_minutes: 2)
......
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