Skip to content

Commit

Permalink
GWP-ASan: Disable crash reporter on for unit tests
Browse files Browse the repository at this point in the history
On macOS, the system crash reporter can take a long time to symbolize
stack traces and cause test time outs. Disable the system crash reporter
for the crash handler unit tests.

Bug: 971247
Change-Id: I74cc5a38279e6a8e97d8498445a98ffdf4671c44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1647082
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
Auto-Submit: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667828}
  • Loading branch information
vlad902 authored and Commit Bot committed Jun 11, 2019
1 parent 705e7fe commit aac2a4f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/gwp_asan/crash_handler/crash_handler_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "third_party/crashpad/crashpad/client/annotation.h"
#include "third_party/crashpad/crashpad/client/crash_report_database.h"
#include "third_party/crashpad/crashpad/client/crashpad_client.h"
#include "third_party/crashpad/crashpad/client/crashpad_info.h"
#include "third_party/crashpad/crashpad/handler/handler_main.h"
#include "third_party/crashpad/crashpad/snapshot/minidump/process_snapshot_minidump.h"
#include "third_party/crashpad/crashpad/tools/tool_support.h"
Expand Down Expand Up @@ -76,6 +77,13 @@ MULTIPROCESS_TEST_MAIN(CrashpadHandler) {

// Child process that launches the crashpad handler and then crashes.
MULTIPROCESS_TEST_MAIN(CrashingProcess) {
#if defined(OS_MACOSX)
// Disable the system crash reporter from inspecting this crash (it is slow
// and causes test timeouts.)
crashpad::CrashpadInfo::GetCrashpadInfo()
->set_system_crash_reporter_forwarding(crashpad::TriState::kDisabled);
#endif

base::NoDestructor<GuardedPageAllocator> gpa;
gpa->Init(AllocatorState::kMaxMetadata, AllocatorState::kMaxMetadata,
kTotalPages, base::DoNothing(), false);
Expand Down

0 comments on commit aac2a4f

Please sign in to comment.