Ban base::debug::DumpWithoutCrashing to prevent test hangs (#31981)
Prevent DumpWithoutCrashing direct use.
This commit is contained in:
@@ -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,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user