Skip to content

Use elastic_delete_by_query in search_spec

Terri Chu requested to merge 427067-fix-flaky-spec-and-speed-it-up into master

What does this MR do and why?

Related to #427067 (closed) and #413976 (closed) and #250331 (closed)

Switch to using elastic_delete_by_query spec to speed things up and hopefully fix the failureflaky-test

Screenshots or screen recordings

local spec runtime before

Finished in 22 minutes 16 seconds (files took 14.66 seconds to load)
31 examples, 1 failure

Failed examples:

rspec './ee/spec/requests/api/search_spec.rb[1:2:1:2:1:1:1:8:1:1]' # API::Search GET /groups/:id/-/search with correct params when elasticsearch is enabled when elasticsearch_limit_indexing is on when the namespace is indexed behaves like elasticsearch enabled for notes scope behaves like pagination returns a different result for each page

Randomized with seed 31765

local spec runtime after

Finished in 11 minutes 24 seconds (files took 14.14 seconds to load)
191 examples, 0 failures

Randomized with seed 31765

How to set up and validate locally

Specs only change, I ran with a failed seed from a pipeline failure (it failed locally too and also took a long time to run)

Test with

bundle exec rspec --seed 31765 ee/spec/requests/api/search_spec.rb

MR acceptance checklist

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

Edited by Terri Chu

Merge request reports

Loading