Flaky specs in save_designs_service_spec.rb
What does this MR do and why?
This MR fixes a leaky example in save_designs_service_spec.rb
. This was made more obvious after we merged additional tests impacted by the leak.
The leak:
issue.reload
doesn't have any effect on issue.design_collections.copy_state
, because issue.design_collections
is memoized. So the redis cache behavior is all fine, but copy_state
leaks between examples through instance vars. That throws off the expected behavior for other examples.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Flaky specs in save_designs_service_spec.rb (#477821 - closed) includes repro instructions
- Alt repro:
rspec spec/services/design_management/save_designs_service_spec.rb:148:168
Related to #477821 (closed)
Edited by Sarah Yasonik