Test failures in spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb
Failures:
1) Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform with invalid file names invalid_file_name: ".git/hooks/pre-commit", converted_file_name: "git-hooks-pre-commit" checks for file path errors when errors are raised
Failure/Error: set_file_path_error(e)
(#<Gitlab::BackgroundMigration::BackfillSnippetRepositories:0x000055e5753c13a0 @snippet_relation=#<ActiveRecord::Relation [#<PersonalSnippet id:1 $1>, #<PersonalSnippet id:2 $2>, #<PersonalSnippet id:3 $3>, #<PersonalSnippet id:4 $4>, #<PersonalSnippet id:5 $5>]>, @invalid_path_error=false, @invalid_signature_error=false, @commit_attrs={:branch_name=>"master", :message=>"Initial commit"}>).set_file_path_error(#<SnippetRepository::CommitError: 2:commit: apply action git2go.CreateFile: invalid path: '.git/hooks/pre-commit'.>)
expected: 1 time with any arguments
received: 2 times with arguments: (#<SnippetRepository::CommitError: 2:commit: apply action git2go.CreateFile: invalid path: '.git/hooks/pre-commit'.>)
# ./lib/gitlab/background_migration/backfill_snippet_repositories.rb:40:in `rescue in block in migrate_snippets'
# ./lib/gitlab/background_migration/backfill_snippet_repositories.rb:35:in `block in migrate_snippets'
# ./lib/gitlab/background_migration/backfill_snippet_repositories.rb:25:in `migrate_snippets'
# ./lib/gitlab/background_migration/backfill_snippet_repositories.rb:13:in `perform'
# ./spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb:45:in `block (2 levels) in <top (required)>'
# ./spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb:212:in `block (5 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
# ./spec/support/database_cleaner.rb:60:in `block (2 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# GRPC::Unknown:
# 2:commit: apply action git2go.CreateFile: invalid path: '.git/hooks/pre-commit'. debug_error_string:{"created":"@1613694770.789999535","description":"Error received from peer unix:tmp/tests/gitaly/praefect.socket","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"commit: apply action git2go.CreateFile: invalid path: '.git/hooks/pre-commit'","grpc_status":2}
# ./lib/gitlab/gitaly_client.rb:177:in `execute'
2) Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform with invalid file names invalid_file_name: ".git/hooks/pre-commit", converted_file_name: "git-hooks-pre-commit" converts invalid filenames
Failure/Error:
fail GRPC::BadStatus.new_status_exception(
status.code, status.details, status.metadata,
status.debug_error_string)
GRPC::NotFound:
5:GetRepoPath: not a git repository: "/builds/gitlab-org/gitlab/tmp/tests/repositories/@snippets/4b/22/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a.git". debug_error_string:{"created":"@1613694775.624568232","description":"Error received from peer unix:tmp/tests/gitaly/praefect.socket","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"GetRepoPath: not a git repository: "/builds/gitlab-org/gitlab/tmp/tests/repositories/@snippets/4b/22/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a.git"","grpc_status":5}
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/gems/grpc-1.30.2-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:29:in `check_status'
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/gems/grpc-1.30.2-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:180:in `attach_status_results_and_complete_call'
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/gems/grpc-1.30.2-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:169:in `receive_and_check_status'
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/gems/grpc-1.30.2-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:337:in `each_remote_read_then_finish'
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/bin/rspec:in `each'
#
# Showing full backtrace because every line was filtered out.
# See docs for RSpec::Configuration#backtrace_exclusion_patterns and
# RSpec::Configuration#backtrace_inclusion_patterns for more information.
3) Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform with invalid file names invalid_file_name: ".", converted_file_name: "snippetfile1.txt" checks for file path errors when errors are raised
Failure/Error: set_file_path_error(e)
(#<Gitlab::BackgroundMigration::BackfillSnippetRepositories:0x000055e559eb5b10 @snippet_relation=#<ActiveRecord::Relation [#<PersonalSnippet id:1 $1>, #<PersonalSnippet id:2 $2>, #<PersonalSnippet id:3 $3>, #<PersonalSnippet id:4 $4>, #<PersonalSnippet id:5 $5>]>, @invalid_path_error=false, @invalid_signature_error=false, @commit_attrs={:branch_name=>"master", :message=>"Initial commit"}>).set_file_path_error(#<SnippetRepository::CommitError: 2:commit: apply action git2go.CreateFile: invalid path: '.'.>)
expected: 1 time with any arguments
received: 2 times with arguments: (#<SnippetRepository::CommitError: 2:commit: apply action git2go.CreateFile: invalid path: '.'.>)
# ./lib/gitlab/background_migration/backfill_snippet_repositories.rb:40:in `rescue in block in migrate_snippets'
# ./lib/gitlab/background_migration/backfill_snippet_repositories.rb:35:in `block in migrate_snippets'
# ./lib/gitlab/background_migration/backfill_snippet_repositories.rb:25:in `migrate_snippets'
# ./lib/gitlab/background_migration/backfill_snippet_repositories.rb:13:in `perform'
# ./spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb:45:in `block (2 levels) in <top (required)>'
# ./spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb:212:in `block (5 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
# ./spec/support/database_cleaner.rb:60:in `block (2 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# GRPC::Unknown:
# 2:commit: apply action git2go.CreateFile: invalid path: '.'. debug_error_string:{"created":"@1613694792.141904344","description":"Error received from peer unix:tmp/tests/gitaly/praefect.socket","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"commit: apply action git2go.CreateFile: invalid path: '.'","grpc_status":2}
# ./lib/gitlab/gitaly_client.rb:177:in `execute'
4) Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform with invalid file names invalid_file_name: ".", converted_file_name: "snippetfile1.txt" converts invalid filenames
Failure/Error:
fail GRPC::BadStatus.new_status_exception(
status.code, status.details, status.metadata,
status.debug_error_string)
GRPC::NotFound:
5:GetRepoPath: not a git repository: "/builds/gitlab-org/gitlab/tmp/tests/repositories/@snippets/4b/22/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a.git". debug_error_string:{"created":"@1613694796.785327384","description":"Error received from peer unix:tmp/tests/gitaly/praefect.socket","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"GetRepoPath: not a git repository: "/builds/gitlab-org/gitlab/tmp/tests/repositories/@snippets/4b/22/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a.git"","grpc_status":5}
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/gems/grpc-1.30.2-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:29:in `check_status'
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/gems/grpc-1.30.2-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:180:in `attach_status_results_and_complete_call'
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/gems/grpc-1.30.2-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:169:in `receive_and_check_status'
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/gems/grpc-1.30.2-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:337:in `each_remote_read_then_finish'
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/bin/rspec:in `each'
#
# Showing full backtrace because every line was filtered out.
# See docs for RSpec::Configuration#backtrace_exclusion_patterns and
# RSpec::Configuration#backtrace_inclusion_patterns for more information.
5) Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform when both user name and snippet file_name are invalid updates the file_name only when it is invalid
Failure/Error:
fail GRPC::BadStatus.new_status_exception(
status.code, status.details, status.metadata,
status.debug_error_string)
GRPC::NotFound:
5:GetRepoPath: not a git repository: "/builds/gitlab-org/gitlab/tmp/tests/repositories/@snippets/4b/22/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a.git". debug_error_string:{"created":"@1613694804.867694042","description":"Error received from peer unix:tmp/tests/gitaly/praefect.socket","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"GetRepoPath: not a git repository: "/builds/gitlab-org/gitlab/tmp/tests/repositories/@snippets/4b/22/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a.git"","grpc_status":5}
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/gems/grpc-1.30.2-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:29:in `check_status'
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/gems/grpc-1.30.2-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:180:in `attach_status_results_and_complete_call'
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/gems/grpc-1.30.2-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:169:in `receive_and_check_status'
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/gems/grpc-1.30.2-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:337:in `each_remote_read_then_finish'
# /builds/gitlab-org/gitlab/vendor/ruby/2.7.0/bin/rspec:in `each'
#
# Showing full backtrace because every line was filtered out.
# See docs for RSpec::Configuration#backtrace_exclusion_patterns and
# RSpec::Configuration#backtrace_inclusion_patterns for more information.
6) Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform when both user name and snippet file_name are invalid increases the number of retries temporarily from 2 to 3
Failure/Error: expect(service).to receive(:create_commit).with(Snippet.find(invalid_snippet.id)).exactly(described_class::MAX_RETRIES + 1).times.and_call_original
(#<Gitlab::BackgroundMigration::BackfillSnippetRepositories:0x000055e55f44f008 @snippet_relation=#<ActiveRecord::Relation [#<PersonalSnippet id:1 $1>, #<PersonalSnippet id:2 $2>, #<PersonalSnippet id:3 $3>, #<PersonalSnippet id:4 $4>, #<PersonalSnippet id:5 $5>]>, @invalid_path_error=false, @invalid_signature_error=false, @commit_attrs={:branch_name=>"master", :message=>"Initial commit"}, @logger=#<Gitlab::BackgroundMigration::Logger:0x000055e55cf056f8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000055e55cf056d0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000055e55cf055b8 @shift_period_suffix="%Y%m%d", @shift_size=1048576, @shift_age=0, @filename=#<Pathname:/builds/gitlab-org/gitlab/log/migrations.log>, @dev=#<File:/builds/gitlab-org/gitlab/log/migrations.log>, @binmode=false, @mon_data=#<Monitor:0x000055e55cf05590>, @mon_data_owner_object_id=317600>>>).create_commit(#<PersonalSnippet id:4 $4>)
expected: 3 times with arguments: (#<PersonalSnippet id:4 $4>)
received: 2 times with arguments: (#<PersonalSnippet id:4 $4>)
# ./spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb:298:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
# ./spec/support/database_cleaner.rb:60:in `block (2 levels) in <top (required)>'
7) Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform when both user name and snippet file_name are invalid behaves like migration_bot user commits files
Failure/Error: expect(last_commit.author_name).to eq migration_bot.name
NoMethodError:
undefined method `author_name' for nil:NilClass
Shared Example Group: "migration_bot user commits files" called from ./spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb:284
# ./spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb:86:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
# ./spec/support/database_cleaner.rb:60:in `block (2 levels) in <top (required)>'
Finished in 13 minutes 28 seconds (files took 54.24 seconds to load)
151 examples, 7 failures
Failed examples:
rspec './spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb[1:1:6:2:1]' # Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform with invalid file names invalid_file_name: ".git/hooks/pre-commit", converted_file_name: "git-hooks-pre-commit" checks for file path errors when errors are raised
rspec './spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb[1:1:6:2:2]' # Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform with invalid file names invalid_file_name: ".git/hooks/pre-commit", converted_file_name: "git-hooks-pre-commit" converts invalid filenames
rspec './spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb[1:1:6:6:1]' # Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform with invalid file names invalid_file_name: ".", converted_file_name: "snippetfile1.txt" checks for file path errors when errors are raised
rspec './spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb[1:1:6:6:2]' # Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform with invalid file names invalid_file_name: ".", converted_file_name: "snippetfile1.txt" converts invalid filenames
rspec ./spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb:277 # Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform when both user name and snippet file_name are invalid updates the file_name only when it is invalid
rspec ./spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb:297 # Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform when both user name and snippet file_name are invalid increases the number of retries temporarily from 2 to 3
rspec './spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb[1:1:9:2:1]' # Gitlab::BackgroundMigration::BackfillSnippetRepositories#perform when both user name and snippet file_name are invalid behaves like migration_bot user commits files
Job #1040847945 failed for 082f68e2: