summaryrefslogtreecommitdiff
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 18:11:53 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 18:11:53 +0000
commit889bf7a0eea1f4ac7c2ec28cdfded399c0ca8fb9 (patch)
treebc2f4d2b049c6bcf4d57cef67c43599c8a6ec888 /spec/spec_helper.rb
parentdad48b4af20204db430a6c62c4641283e24dd89a (diff)
downloadgitlab-ce-889bf7a0eea1f4ac7c2ec28cdfded399c0ca8fb9.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 60a8fb8cb9f..b15d91b41e4 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -92,6 +92,25 @@ RSpec.configure do |config|
config.full_backtrace = true
end
+ # Attempt to troubleshoot https://gitlab.com/gitlab-org/gitlab/-/issues/297359
+ if ENV['CI']
+ config.after do |example|
+ if example.exception.is_a?(GRPC::Unavailable)
+ warn "=== gRPC unavailable detected, process list:"
+ processes = `ps -ef | grep toml`
+ warn processes
+ warn "=== free memory"
+ warn `free -m`
+ warn "=== uptime"
+ warn `uptime`
+ warn "=== Prometheus metrics:"
+ warn `curl -s http://localhost:9236/metrics`
+ warn "=== Taking goroutine dump in log/goroutines.log..."
+ warn `curl -o log/goroutines.log http://localhost:9236/debug/pprof/goroutine?debug=2`
+ end
+ end
+ end
+
unless ENV['CI']
# Re-run failures locally with `--only-failures`
config.example_status_persistence_file_path = './spec/examples.txt'
@@ -340,6 +359,9 @@ RSpec.configure do |config|
# Reset all feature flag stubs to default for testing
stub_all_feature_flags
+
+ # Re-enable query limiting in case it was disabled
+ Gitlab::QueryLimiting.enable!
end
config.before(:example, :mailer) do