Commit 7517e4c5 authored by Stan Hu's avatar Stan Hu

Disable RequestContext deadline checking in tests

This deadline made it difficult to debug feature specs because any
Gitaly calls that were issued would fail after 57 seconds. We disable
this timeout during tests to make it easier to use a debugger.

Closes https://gitlab.com/gitlab-org/gitlab-development-kit/issues/882
parent d8dfa19f
......@@ -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