Commit d6d3f703 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'sh-disable-request-context-deadline-in-test' into 'master'

Disable RequestContext deadline checking in tests

Closes gitlab-development-kit#882

See merge request gitlab-org/gitlab!30423
parents b7509c46 7517e4c5
......@@ -24,6 +24,7 @@ module Gitlab
end
def ensure_deadline_not_exceeded!
return unless enabled?
return unless request_deadline
return if Gitlab::Metrics::System.real_time < request_deadline
......@@ -36,5 +37,9 @@ module Gitlab
def max_request_duration_seconds
Settings.gitlab.max_request_duration_seconds
end
def enabled?
!Rails.env.test?
end
end
end
......@@ -5,6 +5,10 @@ require 'spec_helper'
describe Gitlab::RequestContext, :request_store do
subject { described_class.instance }
before do
allow(subject).to receive(:enabled?).and_return(true)
end
it { is_expected.to have_attributes(client_ip: nil, start_thread_cpu_time: nil, request_start_time: nil) }
describe '#request_deadline' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment