Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 21:25:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 21:25:58 +0300
commita5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch)
treefb69158581673816a8cd895f9d352dcb3c678b1e /spec/lib/gitlab/health_checks
parentd16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff)
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/lib/gitlab/health_checks')
-rw-r--r--spec/lib/gitlab/health_checks/redis/trace_chunks_check_spec.rb8
-rw-r--r--spec/lib/gitlab/health_checks/unicorn_check_spec.rb67
2 files changed, 8 insertions, 67 deletions
diff --git a/spec/lib/gitlab/health_checks/redis/trace_chunks_check_spec.rb b/spec/lib/gitlab/health_checks/redis/trace_chunks_check_spec.rb
new file mode 100644
index 00000000000..5fb5232a4dd
--- /dev/null
+++ b/spec/lib/gitlab/health_checks/redis/trace_chunks_check_spec.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require_relative '../simple_check_shared'
+
+RSpec.describe Gitlab::HealthChecks::Redis::TraceChunksCheck do
+ include_examples 'simple_check', 'redis_trace_chunks_ping', 'RedisTraceChunks', 'PONG'
+end
diff --git a/spec/lib/gitlab/health_checks/unicorn_check_spec.rb b/spec/lib/gitlab/health_checks/unicorn_check_spec.rb
deleted file mode 100644
index 1cc44016002..00000000000
--- a/spec/lib/gitlab/health_checks/unicorn_check_spec.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::HealthChecks::UnicornCheck do
- let(:result_class) { Gitlab::HealthChecks::Result }
- let(:readiness) { described_class.readiness }
- let(:metrics) { described_class.metrics }
-
- before do
- described_class.clear_memoization(:http_servers)
- end
-
- shared_examples 'with state' do |(state, message)|
- it "does provide readiness" do
- expect(readiness).to eq(result_class.new('unicorn_check', state, message))
- end
-
- it "does provide metrics" do
- expect(metrics).to include(
- an_object_having_attributes(name: 'unicorn_check_success', value: state ? 1 : 0))
- expect(metrics).to include(
- an_object_having_attributes(name: 'unicorn_check_latency_seconds', value: be >= 0))
- end
- end
-
- context 'when Unicorn is not loaded' do
- before do
- allow(Gitlab::Runtime).to receive(:unicorn?).and_return(false)
- hide_const('Unicorn')
- end
-
- it "does not provide readiness and metrics" do
- expect(readiness).to be_nil
- expect(metrics).to be_nil
- end
- end
-
- context 'when Unicorn is loaded' do
- let(:http_server_class) { Struct.new(:worker_processes) }
-
- before do
- allow(Gitlab::Runtime).to receive(:unicorn?).and_return(true)
- stub_const('Unicorn::HttpServer', http_server_class)
- end
-
- context 'when no servers are running' do
- it_behaves_like 'with state', [false, 'unexpected Unicorn check result: 0']
- end
-
- context 'when servers without workers are running' do
- before do
- http_server_class.new(0)
- end
-
- it_behaves_like 'with state', [false, 'unexpected Unicorn check result: 0']
- end
-
- context 'when servers with workers are running' do
- before do
- http_server_class.new(1)
- end
-
- it_behaves_like 'with state', true
- end
- end
-end