Skip to content

Improve blob fixture spec error handling

What does this MR do and why?

This change improves the error handling in spec/frontend/fixtures/raw.rb so when a single spec fails it does not disrupt other specs such as NoMethodError caused by a nil value.

Screenshots or screen recordings

One of the fixtures fails on my local, this fix lets me finish the process with a single failure.

Before

Click to expand
$ bundle exec rspec spec/frontend/fixtures/raw.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
WARNING: Gitaly, version 14.4.0-rc43-307-g6715e04b0 does not exactly match repository version 518670d57d1a6527aaf46b5b9bf5cb00f2e8f11b
==> Gitaly set up in 170.238891 seconds...

Test environment set up in 197.801183 seconds
.FFFFFFF

Failures:

  1) Raw files (JavaScript fixtures) blob/notebook/markdown-table.json
     Failure/Error: let(:response) { @blob.data.force_encoding('UTF-8') }
     
     NoMethodError:
       undefined method `data' for nil:NilClass
     # ./spec/frontend/fixtures/raw.rb:10:in `block (2 levels) in <top (required)>'
     # ./spec/support/helpers/javascript_fixtures_helpers.rb:28:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
     # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
     # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
     # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
     # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
     # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
     # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
     # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
     # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
     # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

  2) Raw files (JavaScript fixtures) blob/notebook/worksheets.json
     Got 0 failures and 3 other errors:

     2.1) Failure/Error: connection.send(...)
          
          ActiveRecord::RecordInvalid:
            Validation failed: Path has already been taken
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'
          # ./spec/frontend/fixtures/raw.rb:8:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:9:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:25:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (3 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

     2.2) Failure/Error: connection.send(...)
          
          ActiveRecord::RecordInvalid:
            Validation failed: Path has already been taken
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'
          # ./spec/frontend/fixtures/raw.rb:8:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:9:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:13:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (3 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

     2.3) Failure/Error: let(:response) { @blob.data.force_encoding('UTF-8') }
          
          NoMethodError:
            undefined method `data' for nil:NilClass
          # ./spec/frontend/fixtures/raw.rb:10:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:28:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

  3) Raw files (JavaScript fixtures) blob/notebook/math.json
     Got 0 failures and 3 other errors:

     3.1) Failure/Error: connection.send(...)
          
          ActiveRecord::RecordInvalid:
            Validation failed: Path has already been taken
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'
          # ./spec/frontend/fixtures/raw.rb:8:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:9:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:29:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (3 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

     3.2) Failure/Error: connection.send(...)
          
          ActiveRecord::RecordInvalid:
            Validation failed: Path has already been taken
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'
          # ./spec/frontend/fixtures/raw.rb:8:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:9:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:13:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (3 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

     3.3) Failure/Error: let(:response) { @blob.data.force_encoding('UTF-8') }
          
          NoMethodError:
            undefined method `data' for nil:NilClass
          # ./spec/frontend/fixtures/raw.rb:10:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:28:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

  4) Raw files (JavaScript fixtures) blob/pdf/test.pdf
     Got 0 failures and 3 other errors:

     4.1) Failure/Error: connection.send(...)
          
          ActiveRecord::RecordInvalid:
            Validation failed: Path has already been taken
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'
          # ./spec/frontend/fixtures/raw.rb:8:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:9:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:33:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (3 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

     4.2) Failure/Error: connection.send(...)
          
          ActiveRecord::RecordInvalid:
            Validation failed: Path has already been taken
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'
          # ./spec/frontend/fixtures/raw.rb:8:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:9:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:13:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (3 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

     4.3) Failure/Error: let(:response) { @blob.data.force_encoding('UTF-8') }
          
          NoMethodError:
            undefined method `data' for nil:NilClass
          # ./spec/frontend/fixtures/raw.rb:10:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:28:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

  5) Raw files (JavaScript fixtures) blob/text/README.md
     Got 0 failures and 3 other errors:

     5.1) Failure/Error: connection.send(...)
          
          ActiveRecord::RecordInvalid:
            Validation failed: Path has already been taken
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'
          # ./spec/frontend/fixtures/raw.rb:8:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:9:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:37:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (3 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

     5.2) Failure/Error: connection.send(...)
          
          ActiveRecord::RecordInvalid:
            Validation failed: Path has already been taken
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'
          # ./spec/frontend/fixtures/raw.rb:8:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:9:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:13:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (3 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

     5.3) Failure/Error: let(:response) { @blob.data.force_encoding('UTF-8') }
          
          NoMethodError:
            undefined method `data' for nil:NilClass
          # ./spec/frontend/fixtures/raw.rb:10:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:28:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

  6) Raw files (JavaScript fixtures) blob/images/logo-white.png
     Got 0 failures and 3 other errors:

     6.1) Failure/Error: connection.send(...)
          
          ActiveRecord::RecordInvalid:
            Validation failed: Path has already been taken
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'
          # ./spec/frontend/fixtures/raw.rb:8:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:9:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:41:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (3 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

     6.2) Failure/Error: connection.send(...)
          
          ActiveRecord::RecordInvalid:
            Validation failed: Path has already been taken
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'
          # ./spec/frontend/fixtures/raw.rb:8:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:9:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:13:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (3 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

     6.3) Failure/Error: let(:response) { @blob.data.force_encoding('UTF-8') }
          
          NoMethodError:
            undefined method `data' for nil:NilClass
          # ./spec/frontend/fixtures/raw.rb:10:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:28:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

  7) Raw files (JavaScript fixtures) blob/binary/Gemfile.zip
     Got 0 failures and 3 other errors:

     7.1) Failure/Error: connection.send(...)
          
          ActiveRecord::RecordInvalid:
            Validation failed: Path has already been taken
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'
          # ./spec/frontend/fixtures/raw.rb:8:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:9:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:45:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (3 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

     7.2) Failure/Error: connection.send(...)
          
          ActiveRecord::RecordInvalid:
            Validation failed: Path has already been taken
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'
          # ./lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
          # ./lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'
          # ./spec/frontend/fixtures/raw.rb:8:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:9:in `block (2 levels) in <top (required)>'
          # ./spec/frontend/fixtures/raw.rb:13:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (3 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

     7.3) Failure/Error: let(:response) { @blob.data.force_encoding('UTF-8') }
          
          NoMethodError:
            undefined method `data' for nil:NilClass
          # ./spec/frontend/fixtures/raw.rb:10:in `block (2 levels) in <top (required)>'
          # ./spec/support/helpers/javascript_fixtures_helpers.rb:28:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
          # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
          # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
          # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
          # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
          # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
          # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
          # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
          # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
          # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
          # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
          # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

Finished in 3 minutes 42 seconds (files took 38.47 seconds to load)
8 examples, 7 failures

Failed examples:

rspec ./spec/frontend/fixtures/raw.rb:20 # Raw files (JavaScript fixtures) blob/notebook/markdown-table.json
rspec ./spec/frontend/fixtures/raw.rb:24 # Raw files (JavaScript fixtures) blob/notebook/worksheets.json
rspec ./spec/frontend/fixtures/raw.rb:28 # Raw files (JavaScript fixtures) blob/notebook/math.json
rspec ./spec/frontend/fixtures/raw.rb:32 # Raw files (JavaScript fixtures) blob/pdf/test.pdf
rspec ./spec/frontend/fixtures/raw.rb:36 # Raw files (JavaScript fixtures) blob/text/README.md
rspec ./spec/frontend/fixtures/raw.rb:40 # Raw files (JavaScript fixtures) blob/images/logo-white.png
rspec ./spec/frontend/fixtures/raw.rb:44 # Raw files (JavaScript fixtures) blob/binary/Gemfile.zip

After

Click to expand
$ bundle exec rspec spec/frontend/fixtures/raw.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
WARNING: Gitaly, version 14.4.0-rc43-307-g6715e04b0 does not exactly match repository version 518670d57d1a6527aaf46b5b9bf5cb00f2e8f11b
==> Gitaly set up in 99.304258 seconds...

Test environment set up in 116.73704 seconds
.F......

Failures:

  1) Raw files (JavaScript fixtures) blob/notebook/markdown-table.json
     Failure/Error: @response = project.repository.blob_at(commit, path).data.force_encoding('UTF-8')
     
     NoMethodError:
       undefined method `data' for nil:NilClass
     # ./spec/frontend/fixtures/raw.rb:13:in `blob_at'
     # ./spec/frontend/fixtures/raw.rb:25:in `block (2 levels) in <top (required)>'
     # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (3 levels) in <module:JavaScriptFixturesHelpers>'
     # ./spec/support/helpers/javascript_fixtures_helpers.rb:24:in `block (2 levels) in <module:JavaScriptFixturesHelpers>'
     # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:401:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:397:in `block (3 levels) in <top (required)>'
     # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
     # ./spec/spec_helper.rb:397:in `block (2 levels) in <top (required)>'
     # ./spec/support/database/query_analyzer.rb:9:in `block (3 levels) in <main>'
     # ./lib/gitlab/database/query_analyzer.rb:42:in `within'
     # ./spec/support/database/query_analyzer.rb:9:in `block (2 levels) in <main>'
     # ./spec/support/database/prevent_cross_joins.rb:102:in `block (3 levels) in <main>'
     # ./spec/support/database/prevent_cross_joins.rb:56:in `with_cross_joins_prevented'
     # ./spec/support/database/prevent_cross_joins.rb:102:in `block (2 levels) in <main>'

Finished in 2 minutes 13.6 seconds (files took 36.17 seconds to load)
8 examples, 1 failure

Failed examples:

rspec ./spec/frontend/fixtures/raw.rb:24 # Raw files (JavaScript fixtures) blob/notebook/markdown-table.json

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading