You need to sign in or sign up before continuing.
Fix intermittent elastic-related specs failures
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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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