Fix design flaky specs
What does this MR do?
This MR fixes some flaky design 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.
@rymai did a good analysis of the error #32620 (comment 222564584)
Flaky tests could happen in the following scenario
- the design is created with a
:with_file
trait (thewith_file
trait creates a commit to Gitaly) - the design is given a specific
filename
so doesn't benefit from FactoryBot's unique sequencing for a defaultfilename
- the design is created again between each test, but the issue isn't. E.g., the deisgn in a
before
block and its issue is created in aset
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.
See #32620 (comment 222564584)
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation created/updated or follow-up review issue created
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Performance and Testing
Edited by Luke Duncalfe