Skip to content

Fix design flaky specs

Luke Duncalfe requested to merge 32620-avoid-design-filename-collisions into master

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 (the with_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 default filename
  • 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 a set

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

Performance and Testing

Edited by Luke Duncalfe

Merge request reports