2019-07-07 11:18:12 +05:30
# frozen_string_literal: true
2016-11-03 12:29:30 +05:30
require 'spec_helper'
2023-05-27 22:25:52 +05:30
RSpec . describe 'Every Sidekiq worker' , feature_category : :shared do
2023-06-20 00:43:36 +05:30
include EverySidekiqWorkerTestHelper
2020-03-13 15:44:24 +05:30
let ( :workers_without_defaults ) do
2021-04-29 21:17:54 +05:30
Gitlab :: SidekiqConfig . workers - Gitlab :: SidekiqConfig :: DEFAULT_WORKERS . values
2020-03-13 15:44:24 +05:30
end
2016-11-03 12:29:30 +05:30
it 'does not use the default queue' do
2021-10-27 15:23:28 +05:30
expect ( workers_without_defaults . map ( & :generated_queue_name ) ) . not_to include ( 'default' )
2016-11-03 12:29:30 +05:30
end
it 'uses the cronjob queue when the worker runs as a cronjob' do
2021-10-27 15:23:28 +05:30
expect ( Gitlab :: SidekiqConfig . cron_workers . map ( & :generated_queue_name ) ) . to all ( start_with ( 'cronjob:' ) )
2018-03-17 18:26:18 +05:30
end
2016-11-03 12:29:30 +05:30
2019-02-15 15:39:39 +05:30
it 'has its queue in Gitlab::SidekiqConfig::QUEUE_CONFIG_PATHS' , :aggregate_failures do
2018-03-17 18:26:18 +05:30
file_worker_queues = Gitlab :: SidekiqConfig . worker_queues . to_set
2016-11-03 12:29:30 +05:30
2021-10-27 15:23:28 +05:30
worker_queues = Gitlab :: SidekiqConfig . workers . map ( & :generated_queue_name ) . to_set
2020-07-28 23:09:34 +05:30
worker_queues << ActionMailer :: MailDeliveryJob . new . queue_name
2018-03-17 18:26:18 +05:30
worker_queues << 'default'
missing_from_file = worker_queues - file_worker_queues
2019-02-15 15:39:39 +05:30
expect ( missing_from_file ) . to be_empty , " expected #{ missing_from_file . to_a . inspect } to be in Gitlab::SidekiqConfig::QUEUE_CONFIG_PATHS "
2018-03-17 18:26:18 +05:30
2019-12-26 22:10:19 +05:30
unnecessarily_in_file = file_worker_queues - worker_queues
expect ( unnecessarily_in_file ) . to be_empty , " expected #{ unnecessarily_in_file . to_a . inspect } not to be in Gitlab::SidekiqConfig::QUEUE_CONFIG_PATHS "
2016-11-03 12:29:30 +05:30
end
2018-03-17 18:26:18 +05:30
it 'has its queue or namespace in config/sidekiq_queues.yml' , :aggregate_failures do
config_queues = Gitlab :: SidekiqConfig . config_queues . to_set
Gitlab :: SidekiqConfig . workers . each do | worker |
2021-10-27 15:23:28 +05:30
queue = worker . generated_queue_name
2018-03-17 18:26:18 +05:30
queue_namespace = queue . split ( ':' ) . first
2016-11-03 12:29:30 +05:30
2018-03-17 18:26:18 +05:30
expect ( config_queues ) . to include ( queue ) . or ( include ( queue_namespace ) )
2016-11-03 12:29:30 +05:30
end
end
2019-12-21 20:55:43 +05:30
2020-06-23 00:09:42 +05:30
it 'has a value for loggable_arguments' do
workers_without_defaults . each do | worker |
expect ( worker . klass . loggable_arguments ) . to be_an ( Array )
end
end
2019-12-21 20:55:43 +05:30
describe " feature category declarations " do
let ( :feature_categories ) do
2021-11-18 22:05:49 +05:30
Gitlab :: FeatureCategories . default . categories . map ( & :to_sym ) . to_set
2019-12-21 20:55:43 +05:30
end
# All Sidekiq worker classes should declare a valid `feature_category`
2019-12-26 22:10:19 +05:30
# or explicitly be excluded with the `feature_category_not_owned!` annotation.
2020-08-09 01:23:26 +05:30
# Please see doc/development/sidekiq_style_guide.md#feature-categorization for more details.
2022-06-21 17:19:12 +05:30
it 'has a feature_category attribute' , :aggregate_failures do
2020-03-13 15:44:24 +05:30
workers_without_defaults . each do | worker |
2019-12-21 20:55:43 +05:30
expect ( worker . get_feature_category ) . to be_a ( Symbol ) , " expected #{ worker . inspect } to declare a feature_category or feature_category_not_owned! "
end
end
# All Sidekiq worker classes should declare a valid `feature_category`.
# The category should match a value in `config/feature_categories.yml`.
2020-08-09 01:23:26 +05:30
# Please see doc/development/sidekiq_style_guide.md#feature-categorization for more details.
2019-12-21 20:55:43 +05:30
it 'has a feature_category that maps to a value in feature_categories.yml' , :aggregate_failures do
2020-03-13 15:44:24 +05:30
workers_with_feature_categories = workers_without_defaults
2019-12-21 20:55:43 +05:30
. select ( & :get_feature_category )
. reject ( & :feature_category_not_owned? )
workers_with_feature_categories . each do | worker |
expect ( feature_categories ) . to include ( worker . get_feature_category ) , " expected #{ worker . inspect } to declare a valid feature_category, but got #{ worker . get_feature_category } "
end
end
2019-12-26 22:10:19 +05:30
# Memory-bound workers are very expensive to run, since they need to run on nodes with very low
# concurrency, so that each job can consume a large amounts of memory. For this reason, on
# GitLab.com, when a large number of memory-bound jobs arrive at once, we let them queue up
# rather than scaling the hardware to meet the SLO. For this reason, memory-bound,
2020-04-08 14:13:33 +05:30
# high urgency jobs are explicitly discouraged and disabled.
it 'is (exclusively) memory-bound or high urgency, not both' , :aggregate_failures do
high_urgency_workers = workers_without_defaults
. select { | worker | worker . get_urgency == :high }
2019-12-26 22:10:19 +05:30
2020-04-08 14:13:33 +05:30
high_urgency_workers . each do | worker |
expect ( worker . get_worker_resource_boundary ) . not_to eq ( :memory ) , " #{ worker . inspect } cannot be both memory-bound and high urgency "
2019-12-26 22:10:19 +05:30
end
end
2020-04-08 14:13:33 +05:30
# In high traffic installations, such as GitLab.com, `urgency :high` workers run in a
# dedicated fleet. In order to ensure short queue times, `urgency :high` jobs have strict
2019-12-26 22:10:19 +05:30
# SLOs in order to ensure throughput. However, when a worker depends on an external service,
# such as a user's k8s cluster or a third-party internet service, we cannot guarantee latency,
# and therefore throughput. An outage to an 3rd party service could therefore impact throughput
2020-04-08 14:13:33 +05:30
# on other high urgency jobs, leading to degradation through the GitLab application.
# Please see doc/development/sidekiq_style_guide.md#jobs-with-external-dependencies for more
2019-12-26 22:10:19 +05:30
# details.
2020-04-08 14:13:33 +05:30
it 'has (exclusively) external dependencies or is high urgency, not both' , :aggregate_failures do
high_urgency_workers = workers_without_defaults
. select { | worker | worker . get_urgency == :high }
2019-12-26 22:10:19 +05:30
2020-04-08 14:13:33 +05:30
high_urgency_workers . each do | worker |
expect ( worker . worker_has_external_dependencies? ) . to be_falsey , " #{ worker . inspect } cannot have both external dependencies and be high urgency "
2019-12-26 22:10:19 +05:30
end
end
2019-12-21 20:55:43 +05:30
end
2021-06-08 01:23:25 +05:30
context 'retries' do
let ( :cronjobs ) do
workers_without_defaults . select { | worker | worker . klass < CronjobQueue }
end
let ( :retry_exception_workers ) do
workers_without_defaults . select { | worker | retry_exceptions . has_key? ( worker . klass . to_s ) }
end
let ( :retry_exceptions ) do
{
'AdjournedProjectDeletionWorker' = > 3 ,
'AdminEmailsWorker' = > 3 ,
'Analytics::CodeReviewMetricsWorker' = > 3 ,
'Analytics::DevopsAdoption::CreateSnapshotWorker' = > 3 ,
'Analytics::InstanceStatistics::CounterJobWorker' = > 3 ,
'Analytics::UsageTrends::CounterJobWorker' = > 3 ,
'ApprovalRules::ExternalApprovalRulePayloadWorker' = > 3 ,
'ApproveBlockedPendingApprovalUsersWorker' = > 3 ,
'ArchiveTraceWorker' = > 3 ,
'AuthorizedKeysWorker' = > 3 ,
'AuthorizedProjectUpdate::UserRefreshOverUserRangeWorker' = > 3 ,
'AuthorizedProjectUpdate::UserRefreshWithLowUrgencyWorker' = > 3 ,
2021-09-04 01:27:46 +05:30
'AuthorizedProjectUpdate::UserRefreshFromReplicaWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'AuthorizedProjectsWorker' = > 3 ,
'AutoDevops::DisableWorker' = > 3 ,
'AutoMergeProcessWorker' = > 3 ,
'BackgroundMigrationWorker' = > 3 ,
2022-04-04 11:22:00 +05:30
'BackgroundMigration::CiDatabaseWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'BuildFinishedWorker' = > 3 ,
'BuildHooksWorker' = > 3 ,
'BuildQueueWorker' = > 3 ,
'BuildSuccessWorker' = > 3 ,
'BulkImportWorker' = > false ,
2023-03-04 22:38:38 +05:30
'BulkImports::ExportRequestWorker' = > 5 ,
2021-06-08 01:23:25 +05:30
'BulkImports::EntityWorker' = > false ,
'BulkImports::PipelineWorker' = > false ,
'Chaos::CpuSpinWorker' = > 3 ,
'Chaos::DbSpinWorker' = > 3 ,
'Chaos::KillWorker' = > false ,
'Chaos::LeakMemWorker' = > 3 ,
'Chaos::SleepWorker' = > 3 ,
'ChatNotificationWorker' = > false ,
2021-09-30 23:02:18 +05:30
'Ci::ArchiveTraceWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'Ci::BatchResetMinutesWorker' = > 10 ,
2021-09-30 23:02:18 +05:30
'Ci::BuildFinishedWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'Ci::BuildPrepareWorker' = > 3 ,
'Ci::BuildScheduleWorker' = > 3 ,
'Ci::BuildTraceChunkFlushWorker' = > 3 ,
2021-11-18 22:05:49 +05:30
'Ci::CreateDownstreamPipelineWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'Ci::DailyBuildGroupReportResultsWorker' = > 3 ,
'Ci::DeleteObjectsWorker' = > 0 ,
'Ci::DropPipelineWorker' = > 3 ,
'Ci::InitialPipelineProcessWorker' = > 3 ,
'Ci::MergeRequests::AddTodoWhenBuildFailsWorker' = > 3 ,
2021-11-18 22:05:49 +05:30
'Ci::Minutes::UpdateProjectAndNamespaceUsageWorker' = > 3 ,
2023-07-09 08:55:56 +05:30
'Ci::Llm::GenerateConfigWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'Ci::PipelineArtifacts::CoverageReportWorker' = > 3 ,
'Ci::PipelineArtifacts::CreateQualityReportWorker' = > 3 ,
'Ci::PipelineBridgeStatusWorker' = > 3 ,
'Ci::PipelineSuccessUnlockArtifactsWorker' = > 3 ,
'Ci::RefDeleteUnlockArtifactsWorker' = > 3 ,
'Ci::ResourceGroups::AssignResourceFromResourceGroupWorker' = > 3 ,
'Ci::TestFailureHistoryWorker' = > 3 ,
'Ci::TriggerDownstreamSubscriptionsWorker' = > 3 ,
2021-09-04 01:27:46 +05:30
'Ci::SyncReportsToReportApprovalRulesWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'CleanupContainerRepositoryWorker' = > 3 ,
'ClusterConfigureIstioWorker' = > 3 ,
'ClusterInstallAppWorker' = > 3 ,
'ClusterPatchAppWorker' = > 3 ,
'ClusterProvisionWorker' = > 3 ,
'ClusterUpdateAppWorker' = > 3 ,
'ClusterUpgradeAppWorker' = > 3 ,
'ClusterWaitForAppInstallationWorker' = > 3 ,
'ClusterWaitForAppUpdateWorker' = > 3 ,
'ClusterWaitForIngressIpAddressWorker' = > 3 ,
2022-07-23 23:45:48 +05:30
'Clusters::Applications::ActivateIntegrationWorker' = > 3 ,
'Clusters::Applications::DeactivateIntegrationWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'Clusters::Applications::UninstallWorker' = > 3 ,
'Clusters::Applications::WaitForUninstallAppWorker' = > 3 ,
'Clusters::Cleanup::AppWorker' = > 3 ,
'Clusters::Cleanup::ProjectNamespaceWorker' = > 3 ,
'Clusters::Cleanup::ServiceAccountWorker' = > 3 ,
'ContainerExpirationPolicies::CleanupContainerRepositoryWorker' = > 0 ,
2023-01-13 00:05:48 +05:30
'ContainerRegistry::DeleteContainerRepositoryWorker' = > 0 ,
2023-07-09 08:55:56 +05:30
'ContainerRegistry::RecordDataRepairDetailWorker' = > 0 ,
2021-06-08 01:23:25 +05:30
'CreateCommitSignatureWorker' = > 3 ,
'CreateGithubWebhookWorker' = > 3 ,
'CreateNoteDiffFileWorker' = > 3 ,
'CreatePipelineWorker' = > 3 ,
2023-03-04 22:38:38 +05:30
'Database::BatchedBackgroundMigration::CiExecutionWorker' = > 0 ,
'Database::BatchedBackgroundMigration::MainExecutionWorker' = > 0 ,
2021-06-08 01:23:25 +05:30
'DeleteContainerRepositoryWorker' = > 3 ,
'DeleteDiffFilesWorker' = > 3 ,
'DeleteMergedBranchesWorker' = > 3 ,
'DeleteStoredFilesWorker' = > 3 ,
'DeleteUserWorker' = > 3 ,
2021-11-18 22:05:49 +05:30
'DependencyProxy::CleanupBlobWorker' = > 3 ,
'DependencyProxy::CleanupManifestWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'Deployments::AutoRollbackWorker' = > 3 ,
'Deployments::FinishedWorker' = > 3 ,
'Deployments::ForwardDeploymentWorker' = > 3 ,
'Deployments::LinkMergeRequestWorker' = > 3 ,
'Deployments::SuccessWorker' = > 3 ,
'Deployments::UpdateEnvironmentWorker' = > 3 ,
2023-03-17 16:20:25 +05:30
'Deployments::ApprovalWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'DesignManagement::CopyDesignCollectionWorker' = > 3 ,
'DesignManagement::NewVersionWorker' = > 3 ,
'DestroyPagesDeploymentsWorker' = > 3 ,
'DetectRepositoryLanguagesWorker' = > 1 ,
'DisallowTwoFactorForGroupWorker' = > 3 ,
'DisallowTwoFactorForSubgroupsWorker' = > 3 ,
'Dora::DailyMetrics::RefreshWorker' = > 3 ,
'ElasticAssociationIndexerWorker' = > 3 ,
'ElasticCommitIndexerWorker' = > 2 ,
'ElasticDeleteProjectWorker' = > 2 ,
'ElasticFullIndexWorker' = > 2 ,
'ElasticIndexingControlWorker' = > 3 ,
'ElasticNamespaceIndexerWorker' = > 2 ,
'ElasticNamespaceRolloutWorker' = > 2 ,
'EmailReceiverWorker' = > 3 ,
'EmailsOnPushWorker' = > 3 ,
'Environments::CanaryIngress::UpdateWorker' = > false ,
'Epics::UpdateEpicsDatesWorker' = > 3 ,
'ErrorTrackingIssueLinkWorker' = > 3 ,
'ExportCsvWorker' = > 3 ,
'ExternalServiceReactiveCachingWorker' = > 3 ,
'FileHookWorker' = > false ,
'FlushCounterIncrementsWorker' = > 3 ,
'Geo::Batch::ProjectRegistrySchedulerWorker' = > 3 ,
'Geo::Batch::ProjectRegistryWorker' = > 3 ,
2021-11-18 22:05:49 +05:30
'Geo::ContainerRepositorySyncWorker' = > 1 ,
2021-06-08 01:23:25 +05:30
'Geo::DesignRepositoryShardSyncWorker' = > false ,
2021-11-18 22:05:49 +05:30
'Geo::DesignRepositorySyncWorker' = > 1 ,
2021-06-08 01:23:25 +05:30
'Geo::DestroyWorker' = > 3 ,
'Geo::EventWorker' = > 3 ,
'Geo::FileRemovalWorker' = > 3 ,
2021-11-18 22:05:49 +05:30
'Geo::ProjectSyncWorker' = > 1 ,
2021-06-08 01:23:25 +05:30
'Geo::RenameRepositoryWorker' = > 3 ,
'Geo::RepositoryCleanupWorker' = > 3 ,
'Geo::RepositoryShardSyncWorker' = > false ,
'Geo::RepositoryVerification::Primary::ShardWorker' = > false ,
'Geo::RepositoryVerification::Primary::SingleWorker' = > false ,
'Geo::RepositoryVerification::Secondary::SingleWorker' = > false ,
'Geo::ReverificationBatchWorker' = > 0 ,
2021-11-18 22:05:49 +05:30
'Geo::Scheduler::Primary::SchedulerWorker' = > false ,
'Geo::Scheduler::SchedulerWorker' = > false ,
'Geo::Scheduler::Secondary::SchedulerWorker' = > false ,
2021-06-08 01:23:25 +05:30
'Geo::VerificationBatchWorker' = > 0 ,
2021-11-18 22:05:49 +05:30
'Geo::VerificationStateBackfillWorker' = > false ,
2021-06-08 01:23:25 +05:30
'Geo::VerificationTimeoutWorker' = > false ,
'Geo::VerificationWorker' = > 3 ,
'GeoRepositoryDestroyWorker' = > 3 ,
'GitGarbageCollectWorker' = > false ,
2023-06-20 00:43:36 +05:30
'Gitlab::BitbucketServerImport::AdvanceStageWorker' = > 3 ,
'Gitlab::BitbucketServerImport::Stage::FinishImportWorker' = > 3 ,
'Gitlab::BitbucketServerImport::Stage::ImportLfsObjectsWorker' = > 3 ,
'Gitlab::BitbucketServerImport::Stage::ImportNotesWorker' = > 3 ,
'Gitlab::BitbucketServerImport::Stage::ImportPullRequestsWorker' = > 3 ,
'Gitlab::BitbucketServerImport::Stage::ImportRepositoryWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'Gitlab::GithubImport::AdvanceStageWorker' = > 3 ,
2022-10-11 01:57:18 +05:30
'Gitlab::GithubImport::ImportReleaseAttachmentsWorker' = > 5 ,
2022-11-25 23:54:43 +05:30
'Gitlab::GithubImport::Attachments::ImportReleaseWorker' = > 5 ,
'Gitlab::GithubImport::Attachments::ImportNoteWorker' = > 5 ,
'Gitlab::GithubImport::Attachments::ImportIssueWorker' = > 5 ,
'Gitlab::GithubImport::Attachments::ImportMergeRequestWorker' = > 5 ,
2021-06-08 01:23:25 +05:30
'Gitlab::GithubImport::ImportDiffNoteWorker' = > 5 ,
'Gitlab::GithubImport::ImportIssueWorker' = > 5 ,
2022-08-13 15:12:31 +05:30
'Gitlab::GithubImport::ImportIssueEventWorker' = > 5 ,
2021-06-08 01:23:25 +05:30
'Gitlab::GithubImport::ImportLfsObjectWorker' = > 5 ,
'Gitlab::GithubImport::ImportNoteWorker' = > 5 ,
2022-10-11 01:57:18 +05:30
'Gitlab::GithubImport::ImportProtectedBranchWorker' = > 5 ,
2023-05-27 22:25:52 +05:30
'Gitlab::GithubImport::ImportCollaboratorWorker' = > 5 ,
2021-06-08 01:23:25 +05:30
'Gitlab::GithubImport::ImportPullRequestMergedByWorker' = > 5 ,
'Gitlab::GithubImport::ImportPullRequestReviewWorker' = > 5 ,
2023-01-13 00:05:48 +05:30
'Gitlab::GithubImport::PullRequests::ImportReviewRequestWorker' = > 5 ,
2023-07-09 08:55:56 +05:30
'Gitlab::GithubImport::PullRequests::ImportReviewWorker' = > 5 ,
'Gitlab::GithubImport::PullRequests::ImportMergedByWorker' = > 5 ,
2021-06-08 01:23:25 +05:30
'Gitlab::GithubImport::ImportPullRequestWorker' = > 5 ,
'Gitlab::GithubImport::RefreshImportJidWorker' = > 5 ,
'Gitlab::GithubImport::Stage::FinishImportWorker' = > 5 ,
'Gitlab::GithubImport::Stage::ImportBaseDataWorker' = > 5 ,
'Gitlab::GithubImport::Stage::ImportIssuesAndDiffNotesWorker' = > 5 ,
2022-08-13 15:12:31 +05:30
'Gitlab::GithubImport::Stage::ImportIssueEventsWorker' = > 5 ,
2021-06-08 01:23:25 +05:30
'Gitlab::GithubImport::Stage::ImportLfsObjectsWorker' = > 5 ,
2022-10-11 01:57:18 +05:30
'Gitlab::GithubImport::Stage::ImportAttachmentsWorker' = > 5 ,
'Gitlab::GithubImport::Stage::ImportProtectedBranchesWorker' = > 5 ,
2021-06-08 01:23:25 +05:30
'Gitlab::GithubImport::Stage::ImportNotesWorker' = > 5 ,
2023-05-27 22:25:52 +05:30
'Gitlab::GithubImport::Stage::ImportCollaboratorsWorker' = > 5 ,
2021-06-08 01:23:25 +05:30
'Gitlab::GithubImport::Stage::ImportPullRequestsMergedByWorker' = > 5 ,
2023-01-13 00:05:48 +05:30
'Gitlab::GithubImport::Stage::ImportPullRequestsReviewRequestsWorker' = > 5 ,
2021-06-08 01:23:25 +05:30
'Gitlab::GithubImport::Stage::ImportPullRequestsReviewsWorker' = > 5 ,
'Gitlab::GithubImport::Stage::ImportPullRequestsWorker' = > 5 ,
'Gitlab::GithubImport::Stage::ImportRepositoryWorker' = > 5 ,
2023-03-04 22:38:38 +05:30
'Gitlab::GithubGistsImport::ImportGistWorker' = > 5 ,
'Gitlab::GithubGistsImport::StartImportWorker' = > 5 ,
'Gitlab::GithubGistsImport::FinishImportWorker' = > 5 ,
2021-06-08 01:23:25 +05:30
'Gitlab::JiraImport::AdvanceStageWorker' = > 5 ,
'Gitlab::JiraImport::ImportIssueWorker' = > 5 ,
'Gitlab::JiraImport::Stage::FinishImportWorker' = > 5 ,
'Gitlab::JiraImport::Stage::ImportAttachmentsWorker' = > 5 ,
'Gitlab::JiraImport::Stage::ImportIssuesWorker' = > 5 ,
'Gitlab::JiraImport::Stage::ImportLabelsWorker' = > 5 ,
'Gitlab::JiraImport::Stage::ImportNotesWorker' = > 5 ,
'Gitlab::JiraImport::Stage::StartImportWorker' = > 5 ,
'GitlabPerformanceBarStatsWorker' = > 3 ,
2023-04-23 21:23:45 +05:30
'GitlabSubscriptions::RefreshSeatsWorker' = > 0 ,
2021-06-08 01:23:25 +05:30
'GitlabShellWorker' = > 3 ,
2021-09-30 23:02:18 +05:30
'GitlabServicePingWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'GroupDestroyWorker' = > 3 ,
'GroupExportWorker' = > false ,
'GroupImportWorker' = > false ,
'GroupSamlGroupSyncWorker' = > 3 ,
'GroupWikis::GitGarbageCollectWorker' = > false ,
'Groups::ScheduleBulkRepositoryShardMovesWorker' = > 3 ,
'Groups::UpdateRepositoryStorageWorker' = > 3 ,
'Groups::UpdateStatisticsWorker' = > 3 ,
'HashedStorage::MigratorWorker' = > 3 ,
'HashedStorage::ProjectMigrateWorker' = > 3 ,
'HashedStorage::ProjectRollbackWorker' = > 3 ,
'HashedStorage::RollbackerWorker' = > 3 ,
'ImportIssuesCsvWorker' = > 3 ,
'ImportSoftwareLicensesWorker' = > 3 ,
'IncidentManagement::AddSeveritySystemNoteWorker' = > 3 ,
'IncidentManagement::ApplyIncidentSlaExceededLabelWorker' = > 3 ,
'IncidentManagement::OncallRotations::PersistAllRotationsShiftsJob' = > 3 ,
'IncidentManagement::OncallRotations::PersistShiftsJob' = > 3 ,
'IncidentManagement::PagerDuty::ProcessIncidentWorker' = > 3 ,
2022-07-23 23:45:48 +05:30
'Integrations::ExecuteWorker' = > 3 ,
'Integrations::IrkerWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'InvalidGpgSignatureUpdateWorker' = > 3 ,
'IssuableExportCsvWorker' = > 3 ,
2022-10-11 01:57:18 +05:30
'Issues::CloseWorker' = > 3 ,
2021-12-11 22:18:48 +05:30
'Issues::PlacementWorker' = > 3 ,
'Issues::RebalancingWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'IterationsUpdateStatusWorker' = > 3 ,
'JiraConnect::SyncBranchWorker' = > 3 ,
'JiraConnect::SyncBuildsWorker' = > 3 ,
'JiraConnect::SyncDeploymentsWorker' = > 3 ,
'JiraConnect::SyncFeatureFlagsWorker' = > 3 ,
'JiraConnect::SyncMergeRequestWorker' = > 3 ,
'JiraConnect::SyncProjectWorker' = > 3 ,
'LdapGroupSyncWorker' = > 3 ,
2022-07-23 23:45:48 +05:30
'Licenses::ResetSubmitLicenseUsageDataBannerWorker' = > 13 ,
2021-06-08 01:23:25 +05:30
'MailScheduler::IssueDueWorker' = > 3 ,
'MailScheduler::NotificationServiceWorker' = > 3 ,
'MembersDestroyer::UnassignIssuablesWorker' = > 3 ,
'MergeRequestCleanupRefsWorker' = > 3 ,
'MergeRequestMergeabilityCheckWorker' = > 3 ,
'MergeRequestResetApprovalsWorker' = > 3 ,
'MergeRequests::AssigneesChangeWorker' = > 3 ,
2023-03-04 22:38:38 +05:30
'MergeRequests::CaptureSuggestedReviewersAcceptedWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'MergeRequests::CreatePipelineWorker' = > 3 ,
'MergeRequests::DeleteSourceBranchWorker' = > 3 ,
2023-01-13 00:05:48 +05:30
'MergeRequests::FetchSuggestedReviewersWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'MergeRequests::HandleAssigneesChangeWorker' = > 3 ,
'MergeRequests::ResolveTodosWorker' = > 3 ,
'MergeRequests::SyncCodeOwnerApprovalRulesWorker' = > 3 ,
'MergeTrains::RefreshWorker' = > 3 ,
'MergeWorker' = > 3 ,
'Metrics::Dashboard::PruneOldAnnotationsWorker' = > 3 ,
'Metrics::Dashboard::SyncDashboardsWorker' = > 3 ,
'MigrateExternalDiffsWorker' = > 3 ,
2022-11-25 23:54:43 +05:30
'Onboarding::IssueCreatedWorker' = > 3 ,
'Onboarding::PipelineCreatedWorker' = > 3 ,
'Onboarding::ProgressWorker' = > 3 ,
'Onboarding::UserAddedWorker' = > 3 ,
2023-04-23 21:23:45 +05:30
'Namespaces::FreeUserCap::OverLimitNotificationWorker' = > false ,
2022-04-04 11:22:00 +05:30
'Namespaces::RefreshRootStatisticsWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'Namespaces::RootStatisticsWorker' = > 3 ,
'Namespaces::ScheduleAggregationWorker' = > 3 ,
2023-06-20 00:43:36 +05:30
'Namespaces::FreeUserCap::NotificationClearingWorker' = > false ,
2021-06-08 01:23:25 +05:30
'NewEpicWorker' = > 3 ,
'NewIssueWorker' = > 3 ,
'NewMergeRequestWorker' = > 3 ,
'NewNoteWorker' = > 3 ,
'ObjectPool::CreateWorker' = > 3 ,
'ObjectPool::DestroyWorker' = > 3 ,
'ObjectPool::JoinWorker' = > 3 ,
'ObjectPool::ScheduleJoinWorker' = > 3 ,
'ObjectStorage::MigrateUploadsWorker' = > 3 ,
2022-10-11 01:57:18 +05:30
'Onboarding::CreateLearnGitlabWorker' = > 3 ,
2022-03-02 08:16:31 +05:30
'Packages::CleanupPackageFileWorker' = > 0 ,
2022-08-13 15:12:31 +05:30
'Packages::Cleanup::ExecutePolicyWorker' = > 0 ,
2021-11-18 22:05:49 +05:30
'Packages::Composer::CacheUpdateWorker' = > false ,
2021-06-08 01:23:25 +05:30
'Packages::Go::SyncPackagesWorker' = > 3 ,
2022-03-02 08:16:31 +05:30
'Packages::MarkPackageFilesForDestructionWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'Packages::Maven::Metadata::SyncWorker' = > 3 ,
'Packages::Nuget::ExtractionWorker' = > 3 ,
'Packages::Rubygems::ExtractionWorker' = > 3 ,
'PagesDomainSslRenewalWorker' = > 3 ,
'PagesDomainVerificationWorker' = > 3 ,
'PagesWorker' = > 3 ,
'PersonalAccessTokens::Groups::PolicyWorker' = > 3 ,
'PersonalAccessTokens::Instance::PolicyWorker' = > 3 ,
'PipelineHooksWorker' = > 3 ,
'PipelineMetricsWorker' = > 3 ,
'PipelineNotificationWorker' = > 3 ,
'PipelineProcessWorker' = > 3 ,
'PostReceive' = > 3 ,
'ProcessCommitWorker' = > 3 ,
2023-03-04 22:38:38 +05:30
'ProductAnalytics::InitializeAnalyticsWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'ProjectCacheWorker' = > 3 ,
'ProjectDestroyWorker' = > 3 ,
'ProjectExportWorker' = > false ,
2022-07-16 23:28:13 +05:30
'ProjectImportScheduleWorker' = > 1 ,
2021-06-08 01:23:25 +05:30
'ProjectScheduleBulkRepositoryShardMovesWorker' = > 3 ,
'ProjectTemplateExportWorker' = > false ,
'ProjectUpdateRepositoryStorageWorker' = > 3 ,
2023-06-20 00:43:36 +05:30
'Projects::DeregisterSuggestedReviewersProjectWorker' = > 3 ,
2022-08-27 11:52:29 +05:30
'Projects::DisableLegacyOpenSourceLicenseForInactiveProjectsWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'Projects::GitGarbageCollectWorker' = > false ,
2022-07-16 23:28:13 +05:30
'Projects::InactiveProjectsDeletionNotificationWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'Projects::PostCreationWorker' = > 3 ,
'Projects::ScheduleBulkRepositoryShardMovesWorker' = > 3 ,
'Projects::UpdateRepositoryStorageWorker' = > 3 ,
2022-05-07 20:08:51 +05:30
'Projects::RefreshBuildArtifactsSizeStatisticsWorker' = > 0 ,
2023-01-13 00:05:48 +05:30
'Projects::RegisterSuggestedReviewersProjectWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'PropagateIntegrationGroupWorker' = > 3 ,
'PropagateIntegrationInheritDescendantWorker' = > 3 ,
'PropagateIntegrationInheritWorker' = > 3 ,
'PropagateIntegrationProjectWorker' = > 3 ,
'PropagateIntegrationWorker' = > 3 ,
'PurgeDependencyProxyCacheWorker' = > 3 ,
'ReactiveCachingWorker' = > 3 ,
'RebaseWorker' = > 3 ,
'RefreshLicenseComplianceChecksWorker' = > 3 ,
'Releases::CreateEvidenceWorker' = > 3 ,
'RemoteMirrorNotificationWorker' = > 3 ,
'RepositoryCheck::BatchWorker' = > false ,
'RepositoryCheck::ClearWorker' = > false ,
'RepositoryCheck::SingleRepositoryWorker' = > false ,
'RepositoryCleanupWorker' = > 3 ,
'RepositoryForkWorker' = > 5 ,
'RepositoryImportWorker' = > false ,
'RepositoryUpdateMirrorWorker' = > false ,
'RepositoryUpdateRemoteMirrorWorker' = > 3 ,
'RequirementsManagement::ImportRequirementsCsvWorker' = > 3 ,
'RequirementsManagement::ProcessRequirementsReportsWorker' = > 3 ,
'RunPipelineScheduleWorker' = > 3 ,
'ScanSecurityReportSecretsWorker' = > 17 ,
'Security::AutoFixWorker' = > 3 ,
'Security::StoreScansWorker' = > 3 ,
2021-09-30 23:02:18 +05:30
'Security::TrackSecureScansWorker' = > 1 ,
2021-06-08 01:23:25 +05:30
'ServiceDeskEmailReceiverWorker' = > 3 ,
'SetUserStatusBasedOnUserCapSettingWorker' = > 3 ,
'SnippetScheduleBulkRepositoryShardMovesWorker' = > 3 ,
'SnippetUpdateRepositoryStorageWorker' = > 3 ,
'Snippets::ScheduleBulkRepositoryShardMovesWorker' = > 3 ,
'Snippets::UpdateRepositoryStorageWorker' = > 3 ,
'StageUpdateWorker' = > 3 ,
'StatusPage::PublishWorker' = > 5 ,
'StoreSecurityReportsWorker' = > 3 ,
'SyncSeatLinkRequestWorker' = > 20 ,
'SyncSeatLinkWorker' = > 12 ,
'SystemHookPushWorker' = > 3 ,
'TodosDestroyer::ConfidentialEpicWorker' = > 3 ,
'TodosDestroyer::ConfidentialIssueWorker' = > 3 ,
'TodosDestroyer::DestroyedIssuableWorker' = > 3 ,
2021-11-11 11:23:49 +05:30
'TodosDestroyer::DestroyedDesignsWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'TodosDestroyer::EntityLeaveWorker' = > 3 ,
'TodosDestroyer::GroupPrivateWorker' = > 3 ,
'TodosDestroyer::PrivateFeaturesWorker' = > 3 ,
'TodosDestroyer::ProjectPrivateWorker' = > 3 ,
'UpdateExternalPullRequestsWorker' = > 3 ,
'UpdateHeadPipelineForMergeRequestWorker' = > 3 ,
'UpdateHighestRoleWorker' = > 3 ,
'UpdateMergeRequestsWorker' = > 3 ,
'UpdateProjectStatisticsWorker' = > 3 ,
'UploadChecksumWorker' = > 3 ,
'Vulnerabilities::Statistics::AdjustmentWorker' = > 3 ,
'VulnerabilityExports::ExportDeletionWorker' = > 3 ,
'VulnerabilityExports::ExportWorker' = > 3 ,
'WaitForClusterCreationWorker' = > 3 ,
'WebHookWorker' = > 4 ,
'WebHooks::DestroyWorker' = > 3 ,
2021-11-11 11:23:49 +05:30
'WebHooks::LogExecutionWorker' = > 3 ,
2021-06-08 01:23:25 +05:30
'Wikis::GitGarbageCollectWorker' = > false ,
2023-06-20 00:43:36 +05:30
'WorkItems::ImportWorkItemsCsvWorker' = > 3 ,
2022-04-04 11:22:00 +05:30
'X509CertificateRevokeWorker' = > 3 ,
2023-07-09 08:55:56 +05:30
'ComplianceManagement::MergeRequests::ComplianceViolationsWorker' = > 3 ,
'Zoekt::IndexerWorker' = > 2
2023-06-20 00:43:36 +05:30
} . merge ( extra_retry_exceptions )
2021-06-08 01:23:25 +05:30
end
it 'uses the default number of retries for new jobs' do
expect ( workers_without_defaults - cronjobs - retry_exception_workers ) . to all ( have_attributes ( retries : true ) )
end
it 'uses zero retries for cronjobs' do
expect ( cronjobs - retry_exception_workers ) . to all ( have_attributes ( retries : false ) )
end
it 'uses specified numbers of retries for workers with exceptions encoded here' , :aggregate_failures do
retry_exception_workers . each do | worker |
expect ( worker . retries ) . to eq ( retry_exceptions [ worker . klass . to_s ] ) ,
2023-06-20 00:43:36 +05:30
" #{ worker . klass } has #{ worker . retries } retries, expected #{ retry_exceptions [ worker . klass ] } "
2021-06-08 01:23:25 +05:30
end
end
end
2016-11-03 12:29:30 +05:30
end