Skip to content

Fix intermittent elastic-related specs failures

Dmitry Gruzd requested to merge fix-intermittent-specs-failures into master

What does this MR do?

This MR fixes elastic-related spec failures similar to https://gitlab.com/gitlab-org/gitlab/-/jobs/859232010. These happen because when we're trying to create a new migrations index we already have one. This MR calls delete_index in the before block to avoid that.

Elastic::Latest::ProjectWikiClassProxy names elasticsearch queries
     Failure/Error: super
     Elasticsearch::Transport::Transport::Errors::BadRequest:
       [400] {"error":{"root_cause":[{"type":"resource_already_exists_exception","reason":"index [gitlab-test-migrations/Aml-UndXRy-whuRq7tUa_Q] already exists","index_uuid":"Aml-UndXRy-whuRq7tUa_Q","index":"gitlab-test-migrations"}],"type":"resource_already_exists_exception","reason":"index [gitlab-test-migrations/Aml-UndXRy-whuRq7tUa_Q] already exists","index_uuid":"Aml-UndXRy-whuRq7tUa_Q","index":"gitlab-test-migrations"},"status":400}
     # ./lib/gitlab/instrumentation/elasticsearch_transport.rb:12:in `perform_request'
     # ./ee/lib/gitlab/elastic/helper.rb:85:in `create_migrations_index'
     # ./ee/spec/support/elastic.rb:8:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:352:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:343:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:339:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:339:in `block (2 levels) in <top (required)>'

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Dmitry Gruzd

Merge request reports