Commit e271deec authored by Stan Hu's avatar Stan Hu
Browse files

Fix order-dependent spec in Gitaly cleanup spec

Stubs for Gitaly calls are memoized by storage and service names in the
`@stubs` class variable. Normally this doesn't cause a problem, but an
example in `spec/lib/gitlab/gitaly_client/cleanup_service_spec.rb`
expected that a new stub would always be instantiated. Since
`spec/services/projects/cleanup_service_spec.rb` preceded
`spec/lib/gitlab/gitaly_client/cleanup_service_spec.rb`, the stub had
already been instantiated, causing the test to fail.

To fix this problem, we just clear out the Gitaly stubs for
`spec/lib/gitlab/gitaly_client/cleanup_service_spec.rb`.

Closes https://gitlab.com/gitlab-org/gitlab/issues/38535
parent 383df322
......@@ -9,6 +9,10 @@ describe Gitlab::GitalyClient::CleanupService do
let(:client) { described_class.new(project.repository) }
 
describe '#apply_bfg_object_map_stream' do
before do
::Gitlab::GitalyClient.clear_stubs!
end
it 'sends an apply_bfg_object_map_stream message' do
expect_next_instance_of(Gitaly::CleanupService::Stub) do |instance|
expect(instance).to receive(:apply_bfg_object_map_stream)
......
Supports Markdown
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