Commit 7d6bcdfc authored by Matija Čupić's avatar Matija Čupić

Use new steal predicate in TableManagementHelpers

parent 03310908
...@@ -164,8 +164,8 @@ module Gitlab ...@@ -164,8 +164,8 @@ module Gitlab
"this could indicate the previous partitioning migration has been rolled back." "this could indicate the previous partitioning migration has been rolled back."
end end
Gitlab::BackgroundMigration.steal(MIGRATION_CLASS_NAME) do |raw_arguments| Gitlab::BackgroundMigration.steal(MIGRATION_CLASS_NAME) do |background_job|
JobArguments.from_array(raw_arguments).source_table_name == table_name.to_s JobArguments.from_array(background_job.args.second).source_table_name == table_name.to_s
end end
primary_key = connection.primary_key(table_name) primary_key = connection.primary_key(table_name)
......
...@@ -513,7 +513,7 @@ RSpec.describe Gitlab::Database::PartitioningMigrationHelpers::TableManagementHe ...@@ -513,7 +513,7 @@ RSpec.describe Gitlab::Database::PartitioningMigrationHelpers::TableManagementHe
context 'finishing pending background migration jobs' do context 'finishing pending background migration jobs' do
let(:source_table_double) { double('table name') } let(:source_table_double) { double('table name') }
let(:raw_arguments) { [1, 50_000, source_table_double, partitioned_table, source_column] } let(:raw_arguments) { [1, 50_000, source_table_double, partitioned_table, source_column] }
let(:background_job) { double('background job', args: raw_arguments) } let(:background_job) { double('background job', args: ['background jobs', raw_arguments]) }
before do before do
allow(migration).to receive(:table_exists?).with(partitioned_table).and_return(true) allow(migration).to receive(:table_exists?).with(partitioned_table).and_return(true)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment