Ruby 3 failures in ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb
This job has the failures: https://gitlab.com/gitlab-org/gitlab/-/jobs/2967128983
Click to expand
1st Try error in ./ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb:171:
(Gitlab::AppLogger (class)).info({:max_project_downloads=>3, :message=>"User exceeded max projects download within set time period for namespace", :namespace_id=>4401, :time_period_s=>60, :username=>"user12"})
expected: 1 time with arguments: ({:max_project_downloads=>3, :message=>"User exceeded max projects download within set time period for namespace", :namespace_id=>4401, :time_period_s=>60, :username=>"user12"})
received: 0 times
RSpec::Retry: 2nd try ./ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb:171
2nd Try error in ./ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb:171:
(Gitlab::AppLogger (class)).info({:max_project_downloads=>3, :message=>"User exceeded max projects download within set time period for namespace", :namespace_id=>4401, :time_period_s=>60, :username=>"user17"})
expected: 1 time with arguments: ({:max_project_downloads=>3, :message=>"User exceeded max projects download within set time period for namespace", :namespace_id=>4401, :time_period_s=>60, :username=>"user17"})
received: 0 times
RSpec::Retry: 3rd try ./ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb:171
3rd Try error in ./ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb:171:
(Gitlab::AppLogger (class)).info({:max_project_downloads=>3, :message=>"User exceeded max projects download within set time period for namespace", :namespace_id=>4401, :time_period_s=>60, :username=>"user22"})
expected: 1 time with arguments: ({:max_project_downloads=>3, :message=>"User exceeded max projects download within set time period for namespace", :namespace_id=>4401, :time_period_s=>60, :username=>"user22"})
received: 0 times
RSpec::Retry: 4th try ./ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb:171
Failures:
1) Users::Abuse::GitAbuse::NamespaceThrottleService.execute when user exceeds the download limit within the set time period for a namespace logs the event
Got 2 failures:
1.1) Failure/Error:
expect(Gitlab::AppLogger).to receive(:info).with(
message: "User exceeded max projects download within set time period for namespace",
username: user.username,
max_project_downloads: limit,
time_period_s: time_period_in_seconds,
namespace_id: namespace.id
)
(Gitlab::AppLogger (class)).info({:max_project_downloads=>3, :message=>"User exceeded max projects download within set time period for namespace", :namespace_id=>4401, :time_period_s=>60, :username=>"user3"})
expected: 1 time with arguments: ({:max_project_downloads=>3, :message=>"User exceeded max projects download within set time period for namespace", :namespace_id=>4401, :time_period_s=>60, :username=>"user3"})
received: 0 times
# ./ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb:79:in `block (4 levels) in <main>'
# ./spec/spec_helper.rb:441:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:432:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:428:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:56:in `with_raw_context'
# ./spec/spec_helper.rb:428:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:265:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/redis.rb:45:in `block (2 levels) in <main>'
# ./spec/support/flaky_tests.rb:27:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
1.2) Failure/Error:
expect(Gitlab::AppLogger).to receive(:info).with({
message: "Namespace-level user ban",
username: user.username,
email: user.email,
namespace_id: namespace.id,
ban_by: described_class.name
})
(Gitlab::AppLogger (class)).info({:ban_by=>"Users::Abuse::GitAbuse::NamespaceThrottleService", :email=>"user5@example.org", :message=>"Namespace-level user ban", :namespace_id=>4401, :username=>"user3"})
expected: 1 time with arguments: ({:ban_by=>"Users::Abuse::GitAbuse::NamespaceThrottleService", :email=>"user5@example.org", :message=>"Namespace-level user ban", :namespace_id=>4401, :username=>"user3"})
received: 0 times
# ./ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb:87:in `block (4 levels) in <main>'
# ./spec/spec_helper.rb:441:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:432:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:428:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:56:in `with_raw_context'
# ./spec/spec_helper.rb:428:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:265:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/redis.rb:45:in `block (2 levels) in <main>'
# ./spec/support/flaky_tests.rb:27:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
2) Users::Abuse::GitAbuse::NamespaceThrottleService.execute when owner exceeds the download limit within the set time period for a namespace logs the notification event but not the ban event
Failure/Error:
expect(Gitlab::AppLogger).to receive(:info).with(
message: "User exceeded max projects download within set time period for namespace",
username: owner.username,
max_project_downloads: limit,
time_period_s: time_period_in_seconds,
namespace_id: namespace.id
)
(Gitlab::AppLogger (class)).info({:max_project_downloads=>3, :message=>"User exceeded max projects download within set time period for namespace", :namespace_id=>4401, :time_period_s=>60, :username=>"user1"})
expected: 1 time with arguments: ({:max_project_downloads=>3, :message=>"User exceeded max projects download within set time period for namespace", :namespace_id=>4401, :time_period_s=>60, :username=>"user1"})
received: 0 times
# ./ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb:132:in `block (4 levels) in <main>'
# ./spec/spec_helper.rb:441:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:432:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:428:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:56:in `with_raw_context'
# ./spec/spec_helper.rb:428:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:265:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/redis.rb:45:in `block (2 levels) in <main>'
# ./spec/support/flaky_tests.rb:27:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
3) Users::Abuse::GitAbuse::NamespaceThrottleService.execute when auto_ban_user_on_excessive_projects_download is disabled logs the notification event but not the ban event
Failure/Error:
expect(Gitlab::AppLogger).to receive(:info).with(
message: "User exceeded max projects download within set time period for namespace",
username: user.username,
max_project_downloads: limit,
time_period_s: time_period_in_seconds,
namespace_id: namespace.id
)
(Gitlab::AppLogger (class)).info({:max_project_downloads=>3, :message=>"User exceeded max projects download within set time period for namespace", :namespace_id=>4401, :time_period_s=>60, :username=>"user27"})
expected: 1 time with arguments: ({:max_project_downloads=>3, :message=>"User exceeded max projects download within set time period for namespace", :namespace_id=>4401, :time_period_s=>60, :username=>"user27"})
received: 0 times
# ./ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb:172:in `block (4 levels) in <main>'
# ./spec/spec_helper.rb:441:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:432:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:428:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:56:in `with_raw_context'
# ./spec/spec_helper.rb:428:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:265:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/redis.rb:45:in `block (2 levels) in <main>'
# ./spec/support/flaky_tests.rb:27:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
Finished in 10.83 seconds (files took 44.29 seconds to load)
3 examples, 3 failures
Failed examples:
rspec ./ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb:78 # Users::Abuse::GitAbuse::NamespaceThrottleService.execute when user exceeds the download limit within the set time period for a namespace logs the event
rspec ./ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb:131 # Users::Abuse::GitAbuse::NamespaceThrottleService.execute when owner exceeds the download limit within the set time period for a namespace logs the notification event but not the ban event
rspec ./ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb:171 # Users::Abuse::GitAbuse::NamespaceThrottleService.execute when auto_ban_user_on_excessive_projects_download is disabled logs the notification event but not the ban event
Edited by Roy Zwambag