Skip to content

spec/object_pool_service: Don't assume `#fetch` inits the pool

What does this MR do and why?

The tests for the ObjectPoolService's #fetch function don't really verify anything except that they can create the pool repository. Most importantly, they don't verify whether we're actually synchronizing changes from the source repository into the object pool as expected.

Gitaly is about to change the FetchIntoObjectPool() RPC to raise an error in case the object pool does not exist anymore. While this to the best of our knowledge doesn't break any "real-world" logic as all code paths create the object pool via CreateObjectPool() first, this breaks the only thing we're testing for in our specs.

Amend the test to instead verify that FetchIntoObjectPool() does what it is supposed to do: given a new reference in the source repository, it shall fetch that reference into the object pool. This prepares for the upcoming change to drop the pool-creation logic in this RPC and improves test coverage of the functionality we really care about.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading