Create a spec helper to analyze tables in tests.

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Some of our rspec tests require the need to "ANALYZE" tables to make sure reltuples have been updated to get the correct count:

Occurrences I could find:

https://gitlab.com/gitlab-org/gitlab-ce/blob/master/spec%2Ffeatures%2Fadmin%2Fdashboard_spec.rb#L20

https://gitlab.com/gitlab-org/gitlab-ce/blob/master/spec%2Flib%2Fgitlab%2Fdatabase%2Fcount%2Freltuples_count_strategy_spec.rb#L18

https://gitlab.com/gitlab-org/gitlab-ce/blob/master/spec%2Flib%2Fgitlab%2Fdatabase%2Fcount%2Freltuples_count_strategy_spec.rb#L34

Right now we are repeating the same piece of code across all such occurrences. We'd be able to refactor this a bit by moving this logic to a helper.

Edited Sep 17, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading