Avoid design flaky specs
Some specs that create a design with a `with_file` trait would fail intermittently with a Gitaly error `A file with this name already exists`. This signalled that a collision in the design.full_path in the spec. The full_path is made from the id of the issue and its name. The failing tests would fail when a `create(:design, :with_file)` was - created in a `before` block - its issue was created in a `set` - and it was setting a specific filename for the design. In this situation, if a capybara spec failed once, it would retry again, and would try to create a design with the same name and save it against the same issue from the last time it ran. This would lead to a full_path conflict. The fix is a combination of: - using the default (dynamically sequenced) filenames for designs that are generated by FactoryBot where possible - if we do set a design that has a `with_file` trait (meaning it will create an underlying commit in Gitaly for the design version) then the issue must be created at the same time as the design is within the test See https://gitlab.com/gitlab-org/gitlab/issues/32620#note_222564584
Showing
Please register or sign in to comment