Skip to content

Clear Sentry and Raven settings after the related tests

Furkan Ayhan requested to merge 432145-fix-timeout-test into master

What does this MR do and why?

When we setup Sentry/Raven, we don't clear their settings. And this causes some flaky tests.

In this MR, we are adding the new clear_sentry_settings method.

Related #432145 (closed)

More explanation: #432145 (comment 1671305713)

How to set up and validate locally

For a quick reproduction, here's the command;

bundle exec rspec -f d spec/lib/gitlab/error_tracking_spec.rb spec/lib/gitlab/http_spec.rb -e "when exceptions for dev should be raised" -e "when there is a DB call in the concurrent thread"
Gitlab::ErrorTracking
  # order random
  .track_and_raise_for_dev_exception
    when exceptions for dev should be raised
      raises the exception
      with tags
        includes additional tags

Gitlab::HTTP
  .get
    when passing async:true
      when there is a DB call in the concurrent thread

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 Furkan Ayhan

Merge request reports