New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 789849 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

crash_reporter: failing tests ServiceFailureCollectorTest.CollectOK, CrashReporterLogsTest.ReadConfig

Project Member Reported by kitching@google.com, Nov 30 2017

Issue description

[ RUN      ] CrashReporterLogsTest.ReadConfig
../../../../../../../../../mnt/host/source/src/platform2/crash-reporter/crash_reporter_logs_test.cc:25: Failure
Value of: store.Load(base::FilePath(kLogConfigFileName))
  Actual: false
Expected: true
[  FAILED  ] CrashReporterLogsTest.ReadConfig (0 ms)
[ RUN      ] ServiceFailureCollectorTest.CollectOK
[INFO:service_failure_collector.cc(54)] Processing service failure: normal collection
[WARNING:crash_collector.cc(552)] Unable to read log configuration file /etc/crash_reporter_logs.conf
../../../../../../../../../mnt/host/source/src/platform2/crash-reporter/service_failure_collector_test.cc:73: Failure
Value of: IsDirectoryEmpty(test_crash_directory_)
  Actual: true
Expected: false
[  FAILED  ] ServiceFailureCollectorTest.CollectOK (1 ms)
[  FAILED  ] 2 tests, listed below:
[  FAILED  ] CrashReporterLogsTest.ReadConfig
[  FAILED  ] ServiceFailureCollectorTest.CollectOK

These test failures occur due to a missing file: crash_reporter_logs.conf

If the package has previously been installed, CollectOK passes since it reads from /etc/crash_reporter_logs.conf.

ReadConfig will always fail since it looks for the file in CWD.


Fix: Copy the file in the test recipe of .gyp, and allow injecting a mock value to change from the default location in /etc.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/5cc58d61a75e933a165ebe0ba158baa77dcd001f

commit 5cc58d61a75e933a165ebe0ba158baa77dcd001f
Author: Joel Kitching <kitching@google.com>
Date: Thu Dec 07 07:22:17 2017

crash: fix service failure collector unittest

ServiceFailureCollectorTest.CollectOK:
Failure due to non-existent /etc/crash_reporter_logs.conf.
However, when being built on a machine which already has
crash-reporter installed, the test will succeed.

CrashReporterLogsTest.ReadConfig:
Failure due to crash_reporter_logs.conf not being found
in CWD.

Modify to mock out the config file path and use the source
tree file instead.

BUG=chromium:789849
TEST=cros_workon --board poppy start crash-reporter
     rm -fr /build/poppy/var/cache/portage/chromeos-base/crash-reporter/
     ebuild-poppy crash-reporter-9999.ebuild clean test

Change-Id: Id0045298a634383838ae9535c25b76156a3840eb
Reviewed-on: https://chromium-review.googlesource.com/798994
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/5cc58d61a75e933a165ebe0ba158baa77dcd001f/crash-reporter/udev_collector.h
[modify] https://crrev.com/5cc58d61a75e933a165ebe0ba158baa77dcd001f/crash-reporter/service_failure_collector_test.cc
[modify] https://crrev.com/5cc58d61a75e933a165ebe0ba158baa77dcd001f/crash-reporter/crash_reporter_logs_test.cc
[modify] https://crrev.com/5cc58d61a75e933a165ebe0ba158baa77dcd001f/crash-reporter/crash-reporter.gyp
[modify] https://crrev.com/5cc58d61a75e933a165ebe0ba158baa77dcd001f/crash-reporter/crash_collector.h

Sign in to add a comment