• 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/test_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/test_util:grpc_test_util_unsecure",
42    ],
43)
44
45grpc_cc_library(
46    name = "call_checker",
47    testonly = True,
48    hdrs = ["call_checker.h"],
49    external_deps = ["absl/log:check"],
50    language = "c++",
51    deps = ["//:gpr"],
52)
53
54grpc_cc_test(
55    name = "memory_quota_test",
56    srcs = ["memory_quota_test.cc"],
57    external_deps = ["gtest"],
58    language = "c++",
59    tags = [
60        "cpu:10",
61        "resource_quota_test",
62    ],
63    uses_event_engine = False,
64    uses_polling = False,
65    deps = [
66        "call_checker",
67        "//:exec_ctx",
68        "//src/core:memory_quota",
69        "//src/core:slice_refcount",
70        "//test/core/test_util:grpc_test_util_unsecure",
71    ],
72)
73
74grpc_cc_test(
75    name = "periodic_update_test",
76    srcs = ["periodic_update_test.cc"],
77    external_deps = ["gtest"],
78    flaky = True,
79    language = "c++",
80    uses_event_engine = False,
81    uses_polling = False,
82    deps = [
83        "//:exec_ctx",
84        "//:gpr",
85        "//src/core:periodic_update",
86    ],
87)
88
89grpc_cc_test(
90    name = "thread_quota_test",
91    srcs = ["thread_quota_test.cc"],
92    external_deps = ["gtest"],
93    language = "c++",
94    uses_event_engine = False,
95    uses_polling = False,
96    deps = ["//src/core:thread_quota"],
97)
98
99grpc_cc_test(
100    name = "resource_quota_test",
101    srcs = ["resource_quota_test.cc"],
102    external_deps = ["gtest"],
103    language = "c++",
104    tags = [
105        "resource_quota_test",
106    ],
107    uses_event_engine = False,
108    uses_polling = False,
109    deps = [
110        "//src/core:resource_quota",
111        "//test/core/test_util:grpc_test_util_unsecure",
112    ],
113)
114
115grpc_cc_test(
116    name = "memory_quota_stress_test",
117    srcs = ["memory_quota_stress_test.cc"],
118    external_deps = [
119        "absl/base:core_headers",
120        "absl/log:log",
121        "absl/strings",
122        "absl/types:optional",
123        "gtest",
124    ],
125    language = "c++",
126    # We only run this test under Linux, and really only care about the
127    # TSAN results.
128    tags = [
129        "no_mac",
130        "no_windows",
131        "resource_quota_test",
132    ],
133    uses_event_engine = False,
134    uses_polling = False,
135    deps = [
136        "//:exec_ctx",
137        "//:gpr",
138        "//src/core:event_engine_memory_allocator",
139        "//src/core:memory_quota",
140        "//test/core/test_util:grpc_test_util_unsecure",
141    ],
142)
143
144grpc_proto_fuzzer(
145    name = "memory_quota_fuzzer",
146    srcs = ["memory_quota_fuzzer.cc"],
147    corpus = "memory_quota_fuzzer_corpus",
148    external_deps = [
149        "absl/status",
150        "absl/strings",
151        "absl/types:optional",
152    ],
153    language = "C++",
154    proto = "memory_quota_fuzzer.proto",
155    proto_deps = ["//test/core/test_util:fuzz_config_vars_proto"],
156    tags = ["no_windows"],
157    uses_event_engine = False,
158    uses_polling = False,
159    deps = [
160        "call_checker",
161        "//:debug_location",
162        "//:exec_ctx",
163        "//:gpr",
164        "//:grpc_trace",
165        "//src/core:closure",
166        "//src/core:error",
167        "//src/core:event_engine_memory_allocator",
168        "//src/core:experiments",
169        "//src/core:memory_quota",
170        "//src/core:useful",
171        "//test/core/test_util:fuzz_config_vars",
172        "//test/core/test_util:grpc_test_util",
173    ],
174)
175