From 50bab126189bb61303186225831b7204d2d06fd5 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Mon, 20 Sep 2021 11:39:16 -0700 Subject: [PATCH] Workaround an upstream migration issue Mark a problematic migration as complete on error, just for this release. --- spec/features/backups_spec.rb | 8 +++++++- spec/gitlab_test_helper.rb | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/spec/features/backups_spec.rb b/spec/features/backups_spec.rb index 7e720b34d8..05eb402a46 100644 --- a/spec/features/backups_spec.rb +++ b/spec/features/backups_spec.rb @@ -17,7 +17,13 @@ describe "Restoring a backup" do # We run migrations once early to get the db into a place where we can set the runner token # Ignore errors, we will run the migrations again after the token - run_migrations + _, status = run_migrations + + # temp workaround https://gitlab.com/gitlab-org/gitlab/-/issues/341299 to unblock release + unless status.success? + mark_migration_complete('20210826145509') + run_migrations + end stdout, status = set_runner_token fail stdout unless status.success? diff --git a/spec/gitlab_test_helper.rb b/spec/gitlab_test_helper.rb index 4b39798394..1790a5eebb 100644 --- a/spec/gitlab_test_helper.rb +++ b/spec/gitlab_test_helper.rb @@ -112,6 +112,13 @@ module Gitlab return [stdout, status] end + def mark_migration_complete(migration) + cmd = full_command("gitlab-rake gitlab:db:mark_migration_complete[#{migration}]") + + stdout, status = Open3.capture2e(cmd) + return [stdout, status] + end + def restart_webservice filters = 'app=webservice' -- GitLab