Why do Cycle Analytics specs run everything 5 times?
These specs are, far and away, our costliest specs.
One immediate red flag to me, as I was looking at them, is that they run almost everything 5 times:
- https://gitlab.com/gitlab-org/gitlab-ce/blob/2f78ee2989cd470d33593e0779ebea13d6de9df7/spec/models/cycle_analytics/code_spec.rb#L30-41
- https://gitlab.com/gitlab-org/gitlab-ce/blob/2f78ee2989cd470d33593e0779ebea13d6de9df7/spec/models/cycle_analytics/code_spec.rb#L63-73
- https://gitlab.com/gitlab-org/gitlab-ce/blob/2f78ee2989cd470d33593e0779ebea13d6de9df7/spec/models/cycle_analytics/issue_spec.rb#L36-43
- https://gitlab.com/gitlab-org/gitlab-ce/blob/2f78ee2989cd470d33593e0779ebea13d6de9df7/spec/models/cycle_analytics/production_spec.rb#L32-36
- https://gitlab.com/gitlab-org/gitlab-ce/blob/2f78ee2989cd470d33593e0779ebea13d6de9df7/spec/models/cycle_analytics/production_spec.rb#L44-49
- https://gitlab.com/gitlab-org/gitlab-ce/blob/2f78ee2989cd470d33593e0779ebea13d6de9df7/spec/models/cycle_analytics/review_spec.rb#L26-28
- https://gitlab.com/gitlab-org/gitlab-ce/blob/2f78ee2989cd470d33593e0779ebea13d6de9df7/spec/models/cycle_analytics/staging_spec.rb#L43-47
- https://gitlab.com/gitlab-org/gitlab-ce/blob/2f78ee2989cd470d33593e0779ebea13d6de9df7/spec/models/cycle_analytics/staging_spec.rb#L55-60
- https://gitlab.com/gitlab-org/gitlab-ce/blob/2f78ee2989cd470d33593e0779ebea13d6de9df7/spec/models/cycle_analytics/test_spec.rb#L27-36
- https://gitlab.com/gitlab-org/gitlab-ce/blob/2f78ee2989cd470d33593e0779ebea13d6de9df7/spec/models/cycle_analytics/test_spec.rb#L44-49
- https://gitlab.com/gitlab-org/gitlab-ce/blob/2f78ee2989cd470d33593e0779ebea13d6de9df7/spec/models/cycle_analytics/test_spec.rb#L57-66
- https://gitlab.com/gitlab-org/gitlab-ce/blob/2f78ee2989cd470d33593e0779ebea13d6de9df7/spec/models/cycle_analytics/test_spec.rb#L74-83
- https://gitlab.com/gitlab-org/gitlab-ce/blob/2f78ee2989cd470d33593e0779ebea13d6de9df7/spec/support/cycle_analytics_helpers/test_generation.rb#L66-80
Why 5 and not 3, or 2? Why do they need to be re-run at all?