New issue
Advanced search Search tips

Issue 865693 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Dec 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Fix DBus-related segfaults when running chromeos_unittests on real chromeos (not linux-chromeos)

Project Member Reported by bpastene@chromium.org, Jul 19

Issue description

See https://ci.chromium.org/p/chromium/builders/luci.chromium.try/chromeos-amd64-generic-rel/49551 where I tried running the suite chromeos_unittests inside cros VMs. Most (all?) tests in that suite fail. A common cause is a crash that looks like:
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8940548897679064512/+/steps/chromeos_unittests__with_patch_/0/logs/NetworkConnectionHandlerImplTest.NetworkConnectionHandlerConnectBlockedByBlacklist/0

Tracking that down, we get a segfault at the following line:
https://codesearch.chromium.org/chromium/src/chromeos/network/network_state_test.cc?rcl=0feb6285e09154d489a4f4fa0088250fabd60d48&l=39

It appears that "dbus_manager->GetShillProfileClient()->GetTestInterface()" returns null. How that service gets initialized in tests looks to be affected by the "use_real_clients" val, defined here:
https://codesearch.chromium.org/chromium/src/chromeos/dbus/dbus_thread_manager.cc?rcl=9b23164fb92716ee24c91f0f5e0497e90110cb5d&l=310

Consequently, adding the command line arg "--dbus-stub" to the test makes it pass:
https://ci.chromium.org/p/chromium/builders/luci.chromium.try/chromeos-amd64-generic-rel/49607

I'm not sure if that's ideal. Since we're in a true cros environment, presumably we'd want to use the "real" clients? IDK what a "client" here is, so I could very well be wrong. For now, I'll add the suite with the "--dbus-stub" arg and if someone tells me it'd be better to run the test w/o it on cros (and it's functional) I'll remove it.
 
Cc: derat@chromium.org
Many Chrome OS unit tests are written in a way which relies on the test interfaces provided by the fake D-Bus client classes.
If we are to run these tests on a real Chrome OS device, it'll take some amount of time to rewrite them.

Is there any design doc or tracking bug to run chromeos_unittests (and other tests) on real Chrome OS devices?
What's the motivation for running Chrome tests on Chrome OS devices? Is there a class of potential bugs that we wouldn't be able to test by running OS_CHROMEOS builds of the same tests on Linux?
Status: WontFix (was: Untriaged)
I don't think we want chromeos_unittests running on device, despite the name. I'm going to remove it as part of a different change.

We still might want base_unittests, media_unittests, or things like that.

Project Member

Comment 4 by bugdroid1@chromium.org, Dec 7

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed

commit 209256f5516f6dd1c7fb5e53fa7c3227f8c79eed
Author: James Cook <jamescook@chromium.org>
Date: Fri Dec 07 18:40:50 2018

Don't allow chromeos unit tests to build in "cros chrome-sdk" shell

The chromeos_* unit test suites are designed to run on Linux, not on
real hardware or in VMs. On the Chromium waterfall they are built
with the linux-chromeos configuration.

Developers using the "cros chrome-sdk" sometimes think they need to
build these targets and run them, either on their host workstation
or on device. The tests aren't expected to work in these environments,
so prevent them from being built.

Bug:  909073 ,  865693 
Test: ninja -C out_eve/Release chromeos_unittests won't compile
Change-Id: Idf8c366f7001ea5bbc744ccba6e627d70f5efebb
Reviewed-on: https://chromium-review.googlesource.com/c/1358509
Commit-Queue: James Cook <jamescook@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614763}
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/build/config/chromeos/rules.gni
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/build/config/compiler/compiler.gni
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/chromeos/BUILD.gn
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/chromeos/components/BUILD.gn
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/chromeos/components/run_all_unittests.cc
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/chromeos/run_all_unittests.cc
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/testing/buildbot/chromium.chromiumos.json
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/testing/buildbot/chromium.fyi.json
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/testing/buildbot/filters/BUILD.gn
[delete] https://crrev.com/1c086040bdda4d0abe86770891aa61de499da645/testing/buildbot/filters/chromeos.chromeos_unittests.filter
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/testing/buildbot/test_suites.pyl
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/testing/buildbot/waterfalls.pyl
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/testing/test.gni
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/ui/chromeos/BUILD.gn
[modify] https://crrev.com/209256f5516f6dd1c7fb5e53fa7c3227f8c79eed/ui/chromeos/run_all_unittests.cc

Sign in to add a comment