Skip to content
代码片段 群组 项目
提交 7ce66c5f 编辑于 作者: dfrazao-gitlab's avatar dfrazao-gitlab
浏览文件

Fix test when the batch_size is 1

上级 9bc2e258
No related branches found
No related tags found
无相关合并请求
...@@ -112,7 +112,7 @@ def time_efficiency ...@@ -112,7 +112,7 @@ def time_efficiency
end end
def can_split?(exception) def can_split?(exception)
attempts >= MAX_ATTEMPTS && TIMEOUT_EXCEPTIONS.include?(exception&.class) && batch_size > sub_batch_size && batch_size >= 2 attempts >= MAX_ATTEMPTS && TIMEOUT_EXCEPTIONS.include?(exception&.class) && batch_size > sub_batch_size && batch_size > 1
end end
def split_and_retry! def split_and_retry!
......
...@@ -305,8 +305,8 @@ ...@@ -305,8 +305,8 @@
it { expect(subject).to be_falsey } it { expect(subject).to be_falsey }
end end
context 'when the batch_size is 1' do # rubocop:disable RSpec/RepeatedExampleGroupBody context 'when the batch_size is 1' do
let(:job) { create(:batched_background_migration_job, :failed, batch_size: 2, sub_batch_size: 4) } let(:job) { create(:batched_background_migration_job, :failed, batch_size: 1) }
let(:exception) { ActiveRecord::StatementTimeout.new } let(:exception) { ActiveRecord::StatementTimeout.new }
it { expect(subject).to be_falsey } it { expect(subject).to be_falsey }
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册