New issue
Advanced search Search tips

Issue 875489 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

crash-reporter unit tests are not hermetic or their dependencies are not correctly marked

Project Member Reported by jwer...@chromium.org, Aug 17

Issue description

What steps will reproduce the problem?
(1) Set up a new board (e.g. chell): ~/trunk/src/scripts/setup_board.sh --board=chell
(2) Build only the crash-reporter package and its dependencies: ~/trunk/src/scripts/build_packages --board=chell crash-reporter
(3) Run crash-reporter unit tests: FEATURES=test emerge-chell crash-reporter

What is the expected result?

Tests pass, since we're building a clean ToT package.

What happens instead?

Some tests fail, because they're not hermetic and depend on packages that are not in the DEPEND line of the crash-reporter ebuild:



[ RUN      ] KernelCollectorTest.CollectBadDirectory
[INFO:kernel_collector.cc(683)] Found 0 kernel crashes in efi-pstore.
[INFO:kernel_collector.cc(639)] Received prior crash notification from kernel (signature kernel-UnspecifiedStackSignature) (handling)
[ERROR:crash_collector.cc(467)] Cannot find user named chronos
[ERROR:crash_collector.cc(494)] Could not find default user info
../../../../../../../tmp/portage/chromeos-base/crash-reporter-0.0.1-r2836/work/crash-reporter-0.0.1/crash-reporter/kernel_collector_test.cc:211: Failure
Value of: FindLog("Unable to create crash directory")
  Actual: false
Expected: true
Did not find expected error string in log: {
Found 0 kernel crashes in efi-pstore.
Received prior crash notification from kernel (signature kernel-UnspecifiedStackSignature) (handling)
Cannot find user named chronos
Could not find default user info
}
[  FAILED  ] KernelCollectorTest.CollectBadDirectory (3 ms)

[ RUN      ] UdevCollectorTest.TestMatches
[INFO:udev_collector.cc(44)] Consent given - collect udev crash info.
[ERROR:process.cc(329)] Exec of /bin/gzip failed:: No such file or directory
[ERROR:udev_collector.cc(119)] Could not create zip file /tmp/.org.chromium.Chromium.i2YCfW/change_card0_drm.20180817.222509.0.log.gz
[WARNING:crash_collector.cc(779)] Problem parsing /etc/lsb-release
[WARNING:crash_collector.cc(799)] Unable to read CHROMEOS_RELEASE_VERSION from /var/spool/crash/lsb-release or /etc/lsb-release
../../../../../../../tmp/portage/chromeos-base/crash-reporter-0.0.1-r2836/work/crash-reporter-0.0.1/crash-reporter/udev_collector_test.cc:145: Failure
      Expected: 1
To be equal to: GetNumFiles(temp_dir_generator_.GetPath(), kCrashLogFilePattern)
      Which is: 0
[INFO:udev_collector.cc(44)] Consent given - collect udev crash info.
[ERROR:process.cc(329)] Exec of /bin/gzip failed:: No such file or directory
[ERROR:udev_collector.cc(119)] Could not create zip file /tmp/.org.chromium.Chromium.i2YCfW/add_state0_cpu.20180817.222509.0.log.gz
[WARNING:crash_collector.cc(779)] Problem parsing /etc/lsb-release
[WARNING:crash_collector.cc(799)] Unable to read CHROMEOS_RELEASE_VERSION from /var/spool/crash/lsb-release or /etc/lsb-release
../../../../../../../tmp/portage/chromeos-base/crash-reporter-0.0.1-r2836/work/crash-reporter-0.0.1/crash-reporter/udev_collector_test.cc:148: Failure
      Expected: 2
To be equal to: GetNumFiles(temp_dir_generator_.GetPath(), kCrashLogFilePattern)
      Which is: 0
[  FAILED  ] UdevCollectorTest.TestMatches (9 ms)

[ RUN      ] UserCollectorTest.GetUserInfoFromName
[ERROR:crash_collector.cc(467)] Cannot find user named root
../../../../../../../tmp/portage/chromeos-base/crash-reporter-0.0.1-r2836/work/crash-reporter-0.0.1/crash-reporter/user_collector_test.cc:436: Failure
Value of: collector_.GetUserInfoFromName("root", &uid, &gid)
  Actual: false
Expected: true
../../../../../../../tmp/portage/chromeos-base/crash-reporter-0.0.1-r2836/work/crash-reporter-0.0.1/crash-reporter/user_collector_test.cc:437: Failure
      Expected: 0
To be equal to: uid
      Which is: 100
../../../../../../../tmp/portage/chromeos-base/crash-reporter-0.0.1-r2836/work/crash-reporter-0.0.1/crash-reporter/user_collector_test.cc:438: Failure
      Expected: 0
To be equal to: gid
      Which is: 100
[  FAILED  ] UserCollectorTest.GetUserInfoFromName (0 ms)



The first and third failures seem to depend on something installing the user database file (or adding the right entries to it). The second one seems to depend on whatever is installing /etc/lsb-release. This is confusing to developers, and annoying because building all packages takes hours on my crappy old z620.
 
Components: -OS>Systems OS>Systems>CrashReporting
Labels: OS-Chrome
Cc: -satorux@chromium.org
Owner: satorux@chromium.org
Status: Assigned (was: Untriaged)
thank you for reporting the issue. I'll have a look.

Sign in to add a comment