Skip to content

Fix flaky spec due to undeterministic DB order

Heinrich Lee Yu requested to merge fix-flaky-iteration-spec into master

What does this MR do?

We do not specify a DB order so we assert using contain_exactly instead of eq.

Sample failure: https://gitlab.com/gitlab-org/gitlab/-/jobs/654996762

  1) Issue scopes iterations .any_iteration returns only issues with an iteration assigned
     Failure/Error: expect(described_class.any_iteration).to eq [iteration1_issue, iteration2_issue]
       expected: [#<Issue id:40 namespace101/project106#1>, #<Issue id:41 namespace102/project107#1>]
            got: #<ActiveRecord::Relation [#<Issue id:41 namespace102/project107#1>, #<Issue id:40 namespace101/project106#1>]>
       (compared using ==)
       Diff:
       @@ -1,3 +1,3 @@
       -[#<Issue id:40 namespace101/project106#1>,
       - #<Issue id:41 namespace102/project107#1>]
       +[#<Issue id:41 namespace102/project107#1>,
       + #<Issue id:40 namespace101/project106#1>]

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Heinrich Lee Yu

Merge request reports