2019-03-30 03:15:48 -04:00
# frozen_string_literal: true
2016-10-21 12:13:41 -04:00
require 'spec_helper'
2020-06-24 11:08:50 -04:00
RSpec . describe 'Every Sidekiq worker' do
2020-01-22 07:08:40 -05:00
let ( :workers_without_defaults ) do
2021-03-16 08:11:31 -04:00
Gitlab :: SidekiqConfig . workers - Gitlab :: SidekiqConfig :: DEFAULT_WORKERS . values
2020-01-22 07:08:40 -05:00
end
2016-10-21 12:13:41 -04:00
it 'does not use the default queue' do
2021-07-20 08:10:29 -04:00
expect ( workers_without_defaults . map ( & :generated_queue_name ) ) . not_to include ( 'default' )
2016-10-21 12:13:41 -04:00
end
it 'uses the cronjob queue when the worker runs as a cronjob' do
2021-07-20 08:10:29 -04:00
expect ( Gitlab :: SidekiqConfig . cron_workers . map ( & :generated_queue_name ) ) . to all ( start_with ( 'cronjob:' ) )
2016-10-21 12:13:41 -04:00
end
2018-11-19 16:29:19 -05:00
it 'has its queue in Gitlab::SidekiqConfig::QUEUE_CONFIG_PATHS' , :aggregate_failures do
2017-11-28 11:16:50 -05:00
file_worker_queues = Gitlab :: SidekiqConfig . worker_queues . to_set
2016-10-21 12:13:41 -04:00
2021-07-20 08:10:29 -04:00
worker_queues = Gitlab :: SidekiqConfig . workers . map ( & :generated_queue_name ) . to_set
2020-07-14 08:09:14 -04:00
worker_queues << ActionMailer :: MailDeliveryJob . new . queue_name
2017-11-28 11:16:50 -05:00
worker_queues << 'default'
missing_from_file = worker_queues - file_worker_queues
2018-11-19 16:29:19 -05:00
expect ( missing_from_file ) . to be_empty , " expected #{ missing_from_file . to_a . inspect } to be in Gitlab::SidekiqConfig::QUEUE_CONFIG_PATHS "
2017-11-28 11:16:50 -05:00
2019-10-30 11:14:17 -04:00
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 "
2017-11-28 11:16:50 -05:00
end
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-07-20 08:10:29 -04:00
queue = worker . generated_queue_name
2017-11-28 11:16:50 -05:00
queue_namespace = queue . split ( ':' ) . first
expect ( config_queues ) . to include ( queue ) . or ( include ( queue_namespace ) )
end
2016-10-21 12:13:41 -04:00
end
2019-10-18 07:11:44 -04:00
2020-06-12 08:08:56 -04:00
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-10-18 07:11:44 -04:00
describe " feature category declarations " do
let ( :feature_categories ) do
2021-10-08 08:11:10 -04:00
Gitlab :: FeatureCategories . default . categories . map ( & :to_sym ) . to_set
2019-10-18 07:11:44 -04:00
end
# All Sidekiq worker classes should declare a valid `feature_category`
2019-10-30 11:14:17 -04:00
# or explicitly be excluded with the `feature_category_not_owned!` annotation.
2020-07-08 17:09:09 -04:00
# Please see doc/development/sidekiq_style_guide.md#feature-categorization for more details.
2019-10-18 07:11:44 -04:00
it 'has a feature_category or feature_category_not_owned! attribute' , :aggregate_failures do
2020-01-22 07:08:40 -05:00
workers_without_defaults . each do | worker |
2019-10-18 07:11:44 -04:00
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-07-08 17:09:09 -04:00
# Please see doc/development/sidekiq_style_guide.md#feature-categorization for more details.
2019-10-18 07:11:44 -04:00
it 'has a feature_category that maps to a value in feature_categories.yml' , :aggregate_failures do
2020-01-22 07:08:40 -05:00
workers_with_feature_categories = workers_without_defaults
2019-10-18 07:11:44 -04:00
. 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-10-30 11:14:17 -04:00
# 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-03-02 13:07:42 -05:00
# 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-10-30 11:14:17 -04:00
2020-03-02 13:07:42 -05:00
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-10-30 11:14:17 -04:00
end
end
2020-03-02 13:07:42 -05:00
# 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-10-30 11:14:17 -04:00
# 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-03-02 13:07:42 -05:00
# 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-10-30 11:14:17 -04:00
# details.
2020-03-02 13:07:42 -05:00
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-10-30 11:14:17 -04:00
2020-03-02 13:07:42 -05:00
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-10-30 11:14:17 -04:00
end
end
2019-10-18 07:11:44 -04:00
end
2021-04-30 14:10:09 -04:00
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::ProjectCreateWorker' = > 3 ,
'AuthorizedProjectUpdate::ProjectGroupLinkCreateWorker' = > 3 ,
'AuthorizedProjectUpdate::UserRefreshOverUserRangeWorker' = > 3 ,
'AuthorizedProjectUpdate::UserRefreshWithLowUrgencyWorker' = > 3 ,
2021-06-16 05:10:10 -04:00
'AuthorizedProjectUpdate::UserRefreshFromReplicaWorker' = > 3 ,
2021-04-30 14:10:09 -04:00
'AuthorizedProjectsWorker' = > 3 ,
'AutoDevops::DisableWorker' = > 3 ,
'AutoMergeProcessWorker' = > 3 ,
'BackgroundMigrationWorker' = > 3 ,
'BuildFinishedWorker' = > 3 ,
'BuildHooksWorker' = > 3 ,
'BuildQueueWorker' = > 3 ,
'BuildSuccessWorker' = > 3 ,
'BulkImportWorker' = > false ,
'BulkImports::EntityWorker' = > false ,
'BulkImports::PipelineWorker' = > false ,
'Chaos::CpuSpinWorker' = > 3 ,
'Chaos::DbSpinWorker' = > 3 ,
'Chaos::KillWorker' = > false ,
'Chaos::LeakMemWorker' = > 3 ,
'Chaos::SleepWorker' = > 3 ,
'ChatNotificationWorker' = > false ,
2021-07-13 11:08:38 -04:00
'Ci::ArchiveTraceWorker' = > 3 ,
2021-04-30 14:10:09 -04:00
'Ci::BatchResetMinutesWorker' = > 10 ,
2021-07-13 11:08:38 -04:00
'Ci::BuildFinishedWorker' = > 3 ,
2021-04-30 14:10:09 -04:00
'Ci::BuildPrepareWorker' = > 3 ,
'Ci::BuildScheduleWorker' = > 3 ,
'Ci::BuildTraceChunkFlushWorker' = > 3 ,
'Ci::CreateCrossProjectPipelineWorker' = > 3 ,
2021-09-23 08:11:29 -04:00
'Ci::CreateDownstreamPipelineWorker' = > 3 ,
2021-04-30 14:10:09 -04:00
'Ci::DailyBuildGroupReportResultsWorker' = > 3 ,
'Ci::DeleteObjectsWorker' = > 0 ,
'Ci::DropPipelineWorker' = > 3 ,
'Ci::InitialPipelineProcessWorker' = > 3 ,
'Ci::MergeRequests::AddTodoWhenBuildFailsWorker' = > 3 ,
2021-10-08 08:11:10 -04:00
'Ci::Minutes::UpdateProjectAndNamespaceUsageWorker' = > 3 ,
2021-04-30 14:10:09 -04:00
'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-06-11 14:10:13 -04:00
'Ci::SyncReportsToReportApprovalRulesWorker' = > 3 ,
2021-04-30 14:10:09 -04:00
'CleanupContainerRepositoryWorker' = > 3 ,
'ClusterConfigureIstioWorker' = > 3 ,
'ClusterInstallAppWorker' = > 3 ,
'ClusterPatchAppWorker' = > 3 ,
'ClusterProvisionWorker' = > 3 ,
'ClusterUpdateAppWorker' = > 3 ,
'ClusterUpgradeAppWorker' = > 3 ,
'ClusterWaitForAppInstallationWorker' = > 3 ,
'ClusterWaitForAppUpdateWorker' = > 3 ,
'ClusterWaitForIngressIpAddressWorker' = > 3 ,
'Clusters::Applications::ActivateServiceWorker' = > 3 ,
'Clusters::Applications::DeactivateServiceWorker' = > 3 ,
'Clusters::Applications::UninstallWorker' = > 3 ,
'Clusters::Applications::WaitForUninstallAppWorker' = > 3 ,
'Clusters::Cleanup::AppWorker' = > 3 ,
'Clusters::Cleanup::ProjectNamespaceWorker' = > 3 ,
'Clusters::Cleanup::ServiceAccountWorker' = > 3 ,
'ContainerExpirationPolicies::CleanupContainerRepositoryWorker' = > 0 ,
'CreateCommitSignatureWorker' = > 3 ,
'CreateGithubWebhookWorker' = > 3 ,
'CreateNoteDiffFileWorker' = > 3 ,
'CreatePipelineWorker' = > 3 ,
'DastSiteValidationWorker' = > 3 ,
'DeleteContainerRepositoryWorker' = > 3 ,
'DeleteDiffFilesWorker' = > 3 ,
'DeleteMergedBranchesWorker' = > 3 ,
'DeleteStoredFilesWorker' = > 3 ,
'DeleteUserWorker' = > 3 ,
2021-09-29 14:12:42 -04:00
'DependencyProxy::CleanupBlobWorker' = > 3 ,
'DependencyProxy::CleanupManifestWorker' = > 3 ,
2021-04-30 14:10:09 -04:00
'Deployments::AutoRollbackWorker' = > 3 ,
'Deployments::DropOlderDeploymentsWorker' = > 3 ,
'Deployments::FinishedWorker' = > 3 ,
'Deployments::ForwardDeploymentWorker' = > 3 ,
'Deployments::LinkMergeRequestWorker' = > 3 ,
'Deployments::SuccessWorker' = > 3 ,
'Deployments::UpdateEnvironmentWorker' = > 3 ,
'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 ,
'Experiments::RecordConversionEventWorker' = > 3 ,
'ExpireBuildInstanceArtifactsWorker' = > 3 ,
'ExpireJobCacheWorker' = > 3 ,
'ExpirePipelineCacheWorker' = > 3 ,
'ExportCsvWorker' = > 3 ,
'ExternalServiceReactiveCachingWorker' = > 3 ,
'FileHookWorker' = > false ,
'FlushCounterIncrementsWorker' = > 3 ,
'Geo::Batch::ProjectRegistrySchedulerWorker' = > 3 ,
'Geo::Batch::ProjectRegistryWorker' = > 3 ,
2021-10-07 14:11:28 -04:00
'Geo::ContainerRepositorySyncWorker' = > 1 ,
2021-04-30 14:10:09 -04:00
'Geo::DesignRepositoryShardSyncWorker' = > false ,
2021-10-07 14:11:28 -04:00
'Geo::DesignRepositorySyncWorker' = > 1 ,
2021-04-30 14:10:09 -04:00
'Geo::DestroyWorker' = > 3 ,
'Geo::EventWorker' = > 3 ,
'Geo::FileDownloadWorker' = > 3 ,
'Geo::FileRegistryRemovalWorker' = > 3 ,
'Geo::FileRemovalWorker' = > 3 ,
2021-10-07 14:11:28 -04:00
'Geo::ProjectSyncWorker' = > 1 ,
2021-04-30 14:10:09 -04:00
'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-10-07 14:11:28 -04:00
'Geo::Scheduler::Primary::SchedulerWorker' = > false ,
'Geo::Scheduler::SchedulerWorker' = > false ,
'Geo::Scheduler::Secondary::SchedulerWorker' = > false ,
2021-04-30 14:10:09 -04:00
'Geo::VerificationBatchWorker' = > 0 ,
2021-09-27 14:12:38 -04:00
'Geo::VerificationStateBackfillWorker' = > false ,
2021-04-30 14:10:09 -04:00
'Geo::VerificationTimeoutWorker' = > false ,
'Geo::VerificationWorker' = > 3 ,
'GeoRepositoryDestroyWorker' = > 3 ,
'GitGarbageCollectWorker' = > false ,
'Gitlab::GithubImport::AdvanceStageWorker' = > 3 ,
'Gitlab::GithubImport::ImportDiffNoteWorker' = > 5 ,
'Gitlab::GithubImport::ImportIssueWorker' = > 5 ,
'Gitlab::GithubImport::ImportLfsObjectWorker' = > 5 ,
'Gitlab::GithubImport::ImportNoteWorker' = > 5 ,
'Gitlab::GithubImport::ImportPullRequestMergedByWorker' = > 5 ,
'Gitlab::GithubImport::ImportPullRequestReviewWorker' = > 5 ,
'Gitlab::GithubImport::ImportPullRequestWorker' = > 5 ,
'Gitlab::GithubImport::RefreshImportJidWorker' = > 5 ,
'Gitlab::GithubImport::Stage::FinishImportWorker' = > 5 ,
'Gitlab::GithubImport::Stage::ImportBaseDataWorker' = > 5 ,
'Gitlab::GithubImport::Stage::ImportIssuesAndDiffNotesWorker' = > 5 ,
'Gitlab::GithubImport::Stage::ImportLfsObjectsWorker' = > 5 ,
'Gitlab::GithubImport::Stage::ImportNotesWorker' = > 5 ,
'Gitlab::GithubImport::Stage::ImportPullRequestsMergedByWorker' = > 5 ,
'Gitlab::GithubImport::Stage::ImportPullRequestsReviewsWorker' = > 5 ,
'Gitlab::GithubImport::Stage::ImportPullRequestsWorker' = > 5 ,
'Gitlab::GithubImport::Stage::ImportRepositoryWorker' = > 5 ,
'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 ,
'Gitlab::PhabricatorImport::ImportTasksWorker' = > 5 ,
'GitlabPerformanceBarStatsWorker' = > 3 ,
'GitlabShellWorker' = > 3 ,
2021-07-08 02:09:14 -04:00
'GitlabServicePingWorker' = > 3 ,
2021-04-30 14:10:09 -04:00
'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 ,
'InvalidGpgSignatureUpdateWorker' = > 3 ,
'IrkerWorker' = > 3 ,
'IssuableExportCsvWorker' = > 3 ,
'IssuePlacementWorker' = > 3 ,
'IssueRebalancingWorker' = > 3 ,
'IterationsUpdateStatusWorker' = > 3 ,
'JiraConnect::SyncBranchWorker' = > 3 ,
'JiraConnect::SyncBuildsWorker' = > 3 ,
'JiraConnect::SyncDeploymentsWorker' = > 3 ,
'JiraConnect::SyncFeatureFlagsWorker' = > 3 ,
'JiraConnect::SyncMergeRequestWorker' = > 3 ,
'JiraConnect::SyncProjectWorker' = > 3 ,
'LdapGroupSyncWorker' = > 3 ,
'MailScheduler::IssueDueWorker' = > 3 ,
'MailScheduler::NotificationServiceWorker' = > 3 ,
'MembersDestroyer::UnassignIssuablesWorker' = > 3 ,
'MergeRequestCleanupRefsWorker' = > 3 ,
'MergeRequestMergeabilityCheckWorker' = > 3 ,
'MergeRequestResetApprovalsWorker' = > 3 ,
'MergeRequests::AssigneesChangeWorker' = > 3 ,
'MergeRequests::CreatePipelineWorker' = > 3 ,
'MergeRequests::DeleteSourceBranchWorker' = > 3 ,
'MergeRequests::HandleAssigneesChangeWorker' = > 3 ,
'MergeRequests::ResolveTodosWorker' = > 3 ,
'MergeRequests::SyncCodeOwnerApprovalRulesWorker' = > 3 ,
'MergeTrains::RefreshWorker' = > 3 ,
'MergeWorker' = > 3 ,
'Metrics::Dashboard::PruneOldAnnotationsWorker' = > 3 ,
'Metrics::Dashboard::SyncDashboardsWorker' = > 3 ,
'MigrateExternalDiffsWorker' = > 3 ,
'NamespacelessProjectDestroyWorker' = > 3 ,
'Namespaces::OnboardingIssueCreatedWorker' = > 3 ,
'Namespaces::OnboardingPipelineCreatedWorker' = > 3 ,
'Namespaces::OnboardingProgressWorker' = > 3 ,
'Namespaces::OnboardingUserAddedWorker' = > 3 ,
'Namespaces::RootStatisticsWorker' = > 3 ,
'Namespaces::ScheduleAggregationWorker' = > 3 ,
'NetworkPolicyMetricsWorker' = > 3 ,
'NewEpicWorker' = > 3 ,
'NewIssueWorker' = > 3 ,
'NewMergeRequestWorker' = > 3 ,
'NewNoteWorker' = > 3 ,
'ObjectPool::CreateWorker' = > 3 ,
'ObjectPool::DestroyWorker' = > 3 ,
'ObjectPool::JoinWorker' = > 3 ,
'ObjectPool::ScheduleJoinWorker' = > 3 ,
'ObjectStorage::BackgroundMoveWorker' = > 5 ,
'ObjectStorage::MigrateUploadsWorker' = > 3 ,
2021-09-29 14:12:42 -04:00
'Packages::Composer::CacheUpdateWorker' = > false ,
2021-04-30 14:10:09 -04:00
'Packages::Go::SyncPackagesWorker' = > 3 ,
'Packages::Maven::Metadata::SyncWorker' = > 3 ,
'Packages::Nuget::ExtractionWorker' = > 3 ,
'Packages::Rubygems::ExtractionWorker' = > 3 ,
'PagesDomainSslRenewalWorker' = > 3 ,
'PagesDomainVerificationWorker' = > 3 ,
'PagesTransferWorker' = > 3 ,
'PagesUpdateConfigurationWorker' = > 3 ,
'PagesWorker' = > 3 ,
'PersonalAccessTokens::Groups::PolicyWorker' = > 3 ,
'PersonalAccessTokens::Instance::PolicyWorker' = > 3 ,
'PipelineHooksWorker' = > 3 ,
'PipelineMetricsWorker' = > 3 ,
'PipelineNotificationWorker' = > 3 ,
'PipelineProcessWorker' = > 3 ,
'PostReceive' = > 3 ,
'ProcessCommitWorker' = > 3 ,
'ProjectCacheWorker' = > 3 ,
'ProjectDailyStatisticsWorker' = > 3 ,
'ProjectDestroyWorker' = > 3 ,
'ProjectExportWorker' = > false ,
'ProjectImportScheduleWorker' = > false ,
'ProjectScheduleBulkRepositoryShardMovesWorker' = > 3 ,
'ProjectServiceWorker' = > 3 ,
'ProjectTemplateExportWorker' = > false ,
'ProjectUpdateRepositoryStorageWorker' = > 3 ,
'Projects::GitGarbageCollectWorker' = > false ,
'Projects::PostCreationWorker' = > 3 ,
'Projects::ScheduleBulkRepositoryShardMovesWorker' = > 3 ,
'Projects::UpdateRepositoryStorageWorker' = > 3 ,
'Prometheus::CreateDefaultAlertsWorker' = > 3 ,
'PropagateIntegrationGroupWorker' = > 3 ,
'PropagateIntegrationInheritDescendantWorker' = > 3 ,
'PropagateIntegrationInheritWorker' = > 3 ,
'PropagateIntegrationProjectWorker' = > 3 ,
'PropagateIntegrationWorker' = > 3 ,
'PropagateServiceTemplateWorker' = > 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 ,
'RepositoryPushAuditEventWorker' = > 3 ,
'RepositoryRemoveRemoteWorker' = > 3 ,
'RepositoryUpdateMirrorWorker' = > false ,
'RepositoryUpdateRemoteMirrorWorker' = > 3 ,
'RequirementsManagement::ImportRequirementsCsvWorker' = > 3 ,
'RequirementsManagement::ProcessRequirementsReportsWorker' = > 3 ,
'RunPipelineScheduleWorker' = > 3 ,
'ScanSecurityReportSecretsWorker' = > 17 ,
'Security::AutoFixWorker' = > 3 ,
'Security::StoreScansWorker' = > 3 ,
2021-07-14 08:09:23 -04:00
'Security::TrackSecureScansWorker' = > 1 ,
2021-04-30 14:10:09 -04:00
'SelfMonitoringProjectCreateWorker' = > 3 ,
'SelfMonitoringProjectDeleteWorker' = > 3 ,
'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-09-14 11:12:05 -04:00
'TodosDestroyer::DestroyedDesignsWorker' = > 3 ,
2021-04-30 14:10:09 -04:00
'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-09-08 05:09:10 -04:00
'WebHooks::LogExecutionWorker' = > 3 ,
2021-04-30 14:10:09 -04:00
'Wikis::GitGarbageCollectWorker' = > false ,
'X509CertificateRevokeWorker' = > 3
}
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 ] ) ,
" #{ worker . klass } has #{ worker . retries } retries, expected #{ retry_exceptions [ worker . klass ] } "
end
end
end
2016-10-21 12:13:41 -04:00
end