diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb')
-rw-r--r-- | spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb b/spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb index abba6cd7734..5d0cb05c8d5 100644 --- a/spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb +++ b/spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Gitlab::GithubImport::RefreshImportJidWorker, feature_category: : it 'schedules a job in the future' do expect(described_class) .to receive(:perform_in) - .with(1.minute.to_i, 10, '123') + .with(5.minutes.to_i, 10, '123') described_class.perform_in_the_future(10, '123') end @@ -33,15 +33,20 @@ RSpec.describe Gitlab::GithubImport::RefreshImportJidWorker, feature_category: : allow(worker) .to receive(:find_import_state) .with(project.id) - .and_return(project) + .and_return(import_state) expect(Gitlab::SidekiqStatus) .to receive(:running?) .with('123') .and_return(true) - expect(project) - .to receive(:refresh_jid_expiration) + expect(Gitlab::SidekiqStatus) + .to receive(:expire) + .with('123', Gitlab::Import::StuckImportJob::IMPORT_JOBS_EXPIRATION) + + expect(Gitlab::SidekiqStatus) + .to receive(:set) + .with(import_state.jid, Gitlab::Import::StuckImportJob::IMPORT_JOBS_EXPIRATION) expect(worker.class) .to receive(:perform_in_the_future) @@ -63,8 +68,11 @@ RSpec.describe Gitlab::GithubImport::RefreshImportJidWorker, feature_category: : .with('123') .and_return(false) - expect(project) - .not_to receive(:refresh_jid_expiration) + expect(Gitlab::SidekiqStatus) + .not_to receive(:expire) + + expect(Gitlab::SidekiqStatus) + .not_to receive(:set) worker.perform(project.id, '123') end |