tests: don't change malloc for tests

system_malloc is causing test flakes.

The issue with tcmalloc is it isn't fork-safe and any allocations in forked
sub-processes can stuck.

PiperOrigin-RevId: 581372831
This commit is contained in:
Andrei Vagin
2023-11-10 14:38:59 -08:00
committed by gVisor bot
parent a5e93550c1
commit 4b00385927
2 changed files with 8 additions and 1 deletions
+2
View File
@@ -4649,6 +4649,8 @@ cc_binary(
testonly = 1,
srcs = ["process_vm_read_write.cc"],
linkstatic = 1,
# tcmalloc isn't fork-safe.
tcmalloc = False,
deps = [
gtest,
"//test/util:logging",
+6 -1
View File
@@ -26,12 +26,13 @@ cc_flags_supplier = rule(
def cc_grpc_library(name, **kwargs):
_cc_grpc_library(name = name, grpc_only = True, **kwargs)
def cc_binary(name, static = False, **kwargs):
def cc_binary(name, static = False, tcmalloc = False, **kwargs):
"""Run cc_binary.
Args:
name: name of the target.
static: make a static binary if True
tcmalloc: use TCMalloc if True (not implemented)
**kwargs: the rest of the args.
"""
if static:
@@ -46,6 +47,10 @@ def cc_binary(name, static = False, **kwargs):
"-lpthread",
"-Wl,--no-whole-archive",
]
if tcmalloc:
# buildifier: disable=print
print("Warning: tcmalloc can't be enabled")
_cc_binary(
name = name,
**kwargs