• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 gRPC authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_package")
16load("//test/core/util:grpc_fuzzer.bzl", "grpc_proto_fuzzer")
17
18licenses(["notice"])
19
20grpc_package(name = "test/core/resource_quota")
21
22grpc_cc_test(
23    name = "arena_test",
24    srcs = ["arena_test.cc"],
25    external_deps = [
26        "absl/strings",
27        "gtest",
28    ],
29    language = "C++",
30    tags = [
31        "resource_quota_test",
32    ],
33    uses_event_engine = False,
34    uses_polling = False,
35    deps = [
36        "//:exec_ctx",
37        "//:gpr",
38        "//:ref_counted_ptr",
39        "//src/core:arena",
40        "//src/core:resource_quota",
41        "//test/core/util:grpc_test_util_unsecure",
42    ],
43)
44
45grpc_cc_library(
46    name = "call_checker",
47    testonly = True,
48    hdrs = ["call_checker.h"],
49    language = "c++",
50    deps = ["//:gpr"],
51)
52
53grpc_cc_test(
54    name = "memory_quota_test",
55    srcs = ["memory_quota_test.cc"],
56    external_deps = ["gtest"],
57    language = "c++",
58    tags = [
59        "cpu:10",
60        "resource_quota_test",
61    ],
62    uses_event_engine = False,
63    uses_polling = False,
64    deps = [
65        "call_checker",
66        "//:exec_ctx",
67        "//src/core:memory_quota",
68        "//src/core:slice_refcount",
69        "//test/core/util:grpc_test_util_unsecure",
70    ],
71)
72
73grpc_cc_test(
74    name = "periodic_update_test",
75    srcs = ["periodic_update_test.cc"],
76    external_deps = ["gtest"],
77    flaky = True,
78    language = "c++",
79    uses_event_engine = False,
80    uses_polling = False,
81    deps = [
82        "//:exec_ctx",
83        "//:gpr",
84        "//src/core:periodic_update",
85    ],
86)
87
88grpc_cc_test(
89    name = "thread_quota_test",
90    srcs = ["thread_quota_test.cc"],
91    external_deps = ["gtest"],
92    language = "c++",
93    uses_event_engine = False,
94    uses_polling = False,
95    deps = ["//src/core:thread_quota"],
96)
97
98grpc_cc_test(
99    name = "resource_quota_test",
100    srcs = ["resource_quota_test.cc"],
101    external_deps = ["gtest"],
102    language = "c++",
103    tags = [
104        "resource_quota_test",
105    ],
106    uses_event_engine = False,
107    uses_polling = False,
108    deps = [
109        "//src/core:resource_quota",
110        "//test/core/util:grpc_test_util_unsecure",
111    ],
112)
113
114grpc_cc_test(
115    name = "memory_quota_stress_test",
116    srcs = ["memory_quota_stress_test.cc"],
117    external_deps = [
118        "absl/base:core_headers",
119        "absl/strings",
120        "absl/types:optional",
121        "gtest",
122    ],
123    language = "c++",
124    # We only run this test under Linux, and really only care about the
125    # TSAN results.
126    tags = [
127        "no_mac",
128        "no_windows",
129        "resource_quota_test",
130    ],
131    uses_event_engine = False,
132    uses_polling = False,
133    deps = [
134        "//:exec_ctx",
135        "//:gpr",
136        "//src/core:event_engine_memory_allocator",
137        "//src/core:memory_quota",
138        "//test/core/util:grpc_test_util_unsecure",
139    ],
140)
141
142grpc_proto_fuzzer(
143    name = "memory_quota_fuzzer",
144    srcs = ["memory_quota_fuzzer.cc"],
145    corpus = "memory_quota_fuzzer_corpus",
146    external_deps = [
147        "absl/status",
148        "absl/strings",
149        "absl/types:optional",
150    ],
151    language = "C++",
152    proto = "memory_quota_fuzzer.proto",
153    proto_deps = ["//test/core/util:fuzz_config_vars_proto"],
154    tags = ["no_windows"],
155    uses_event_engine = False,
156    uses_polling = False,
157    deps = [
158        "call_checker",
159        "//:debug_location",
160        "//:exec_ctx",
161        "//:gpr",
162        "//:grpc_trace",
163        "//src/core:closure",
164        "//src/core:error",
165        "//src/core:event_engine_memory_allocator",
166        "//src/core:experiments",
167        "//src/core:memory_quota",
168        "//src/core:useful",
169        "//test/core/util:fuzz_config_vars",
170    ],
171)
172