Ban base::debug::DumpWithoutCrashing to prevent test hangs (#31981)

Prevent DumpWithoutCrashing direct use.
This commit is contained in:
Aleksei Khoroshilov
2025-10-23 17:56:16 +07:00
committed by GitHub
parent 7cdba8e1dd
commit 6197d975b8
+11
View File
@@ -271,6 +271,7 @@ def CheckNewThemeFilesForUpstreamOverride(input_api, output_api):
]
return []
def CheckNewSourceFileWithoutGnChangeOnUpload(input_api, output_api):
"""Checks newly added source files have corresponding GN changes."""
files_to_skip = input_api.DEFAULT_FILES_TO_SKIP + (r"chromium_src/.*", )
@@ -417,6 +418,16 @@ _BANNED_CPP_FUNCTIONS += (
explanation=('Please use `absl::StrAppendFormat` rather.', ),
treat_as_error=False,
),
BanRule(
'base::debug::DumpWithoutCrashing',
explanation=(
'Please use `DUMP_WILL_BE_NOTREACHED()` instead.',
'This prevents dumps and NOTREACHED in tests for the following reasons:',
' * Dumps can hang tests.',
' * NOTREACHED is a test failure unless it is an EXPECT_DEATH test.',
),
treat_as_error=True,
),
)