Skip to content

Improve ES specs runtime

Dmitry Gruzd requested to merge speed-up-elastic-specs into master

What does this MR do?

This MR sets elasticsearch_replicas to 0 for a test environment, fixes the problem with YELLOW cluster state when we execute specs on 1-node cluster and also improves the performance of :elastic examples.

Performance comparison using hyperfine

Before

❯ hyperfine --warmup 3 'bin/rspec ee/spec/models/concerns/elastic/project_spec.rb:20'
Benchmark #1: bin/rspec ee/spec/models/concerns/elastic/project_spec.rb:20
  Time (mean ± σ):      6.934 s ±  0.062 s    [User: 102.5 ms, System: 12.1 ms]
  Range (min … max):    6.821 s …  7.054 s    10 runs

After

❯ hyperfine --warmup 3 'bin/rspec ee/spec/models/concerns/elastic/project_spec.rb:20'
Benchmark #1: bin/rspec ee/spec/models/concerns/elastic/project_spec.rb:20
  Time (mean ± σ):      6.304 s ±  0.055 s    [User: 100.4 ms, System: 13.6 ms]
  Range (min … max):    6.172 s …  6.365 s    10 runs

Screenshots

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 🤖 GitLab Bot 🤖

Merge request reports

Loading