broken migration tests - PG::UndefinedTable: ERROR: relation "public.untracked_files_for_uploads" does not exist

migration tests randomly fail in EE pipeline, for example:

  • https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/48288547
  • https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/48306998

The error is: FixWronglyRenamedRoutes #wrongly_renamed 2nd Try error in ./spec/migrations/fix_wrongly_renamed_routes_spec.rb:13: PG::UndefinedTable: ERROR: relation "public.untracked_files_for_uploads" does not exist

It seems the problem is that database cleaner tries to truncate table which was removed in a previous migration (db/post_migrate/20171103140253_track_untracked_uploads.rb)

Reproducer:

  • make sure that table "untracked_files_for_uploads" exists in test db: psql -h /home/honza/gitlab-development-kit/postgresql gitlabhq_test; create table untracked_files_for_uploads (id integer);
  • run bundle exec rspec spec/migrations/track_untracked_uploads_spec.rb ./spec/migrations/fix_wrongly_renamed_routes_spec.rb
Assignee Loading
Time tracking Loading