Skip to content
代码片段 群组 项目
未验证 提交 7636c53e 编辑于 作者: Luke Duncalfe's avatar Luke Duncalfe 提交者: GitLab
浏览文件

Revert "Increase validation timeout in gitlab_schema.rb"

This reverts commit 7b4eca5d.
上级 8de5ba4c
No related branches found
No related tags found
无相关合并请求
...@@ -32,7 +32,7 @@ class GitlabSchema < GraphQL::Schema ...@@ -32,7 +32,7 @@ class GitlabSchema < GraphQL::Schema
default_max_page_size 100 default_max_page_size 100
validate_max_errors 5 validate_max_errors 5
validate_timeout 0.5.seconds validate_timeout 0.2.seconds
lazy_resolve ::Gitlab::Graphql::Lazy, :force lazy_resolve ::Gitlab::Graphql::Lazy, :force
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
end end
it 'sets an appropriate validation timeout' do it 'sets an appropriate validation timeout' do
expect(described_class.validate_timeout).to be <= 0.5.seconds expect(described_class.validate_timeout).to be <= 0.2.seconds
end end
describe '.execute' do describe '.execute' do
......
...@@ -461,6 +461,7 @@ def all_graphql_fields_for(class_name, max_depth: 3, excluded: []) ...@@ -461,6 +461,7 @@ def all_graphql_fields_for(class_name, max_depth: 3, excluded: [])
allow_unlimited_graphql_complexity allow_unlimited_graphql_complexity
allow_unlimited_graphql_depth if max_depth > 1 allow_unlimited_graphql_depth if max_depth > 1
allow_unlimited_validation_timeout
allow_high_graphql_recursion allow_high_graphql_recursion
allow_high_graphql_transaction_threshold allow_high_graphql_transaction_threshold
allow_high_graphql_query_size allow_high_graphql_query_size
...@@ -727,6 +728,11 @@ def allow_unlimited_graphql_depth ...@@ -727,6 +728,11 @@ def allow_unlimited_graphql_depth
allow(GitlabSchema).to receive(:max_query_depth).with(any_args).and_return nil allow(GitlabSchema).to receive(:max_query_depth).with(any_args).and_return nil
end end
def allow_unlimited_validation_timeout
allow_any_instance_of(GitlabSchema).to receive(:validate_timeout).and_return nil
allow(GitlabSchema).to receive(:validate_timeout).with(any_args).and_return nil
end
def allow_high_graphql_recursion def allow_high_graphql_recursion
allow_any_instance_of(Gitlab::Graphql::QueryAnalyzers::AST::RecursionAnalyzer).to receive(:recursion_threshold).and_return 1000 allow_any_instance_of(Gitlab::Graphql::QueryAnalyzers::AST::RecursionAnalyzer).to receive(:recursion_threshold).and_return 1000
end end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册