From 6f007d685b81093c7c399fc379f4e0da4f019e9d Mon Sep 17 00:00:00 2001 From: Maksim Sisov Date: Fri, 5 Mar 2021 18:11:33 +0000 Subject: [PATCH] ozone/wayland: launch dbus for tests with Wayland dbus_unittests failed in Ozone/Wayland tester as long as dbus wasn't launched. The error message about missing "$DISPLAY for X11" was misleading, and it was just rather required to launch dbus via xvfb script. This CL fixes the issue by reusing the existing method in the same script that is able to launch Dbus for Wayland as well (the "xvfb.py --use-weston --no-xvfb" case). Bug: 1184129 Change-Id: Ie0580e280c10344c3795cf4ac46575bfe4a3dff6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2739479 Auto-Submit: Maksim Sisov Commit-Queue: Dirk Pranke Reviewed-by: Dirk Pranke Cr-Commit-Position: refs/heads/master@{#860288} --- dbus/BUILD.gn | 2 -- testing/buildbot/chromium.linux.json | 3 +-- testing/buildbot/filters/BUILD.gn | 7 ------- .../filters/ozone-linux.dbus_unittests_wayland.filter | 5 ----- testing/buildbot/test_suite_exceptions.pyl | 10 ---------- testing/xvfb.py | 7 +++++++ 6 files changed, 8 insertions(+), 26 deletions(-) delete mode 100644 testing/buildbot/filters/ozone-linux.dbus_unittests_wayland.filter diff --git a/dbus/BUILD.gn b/dbus/BUILD.gn index 1dd5d7dc0d308f..514fb81df616cf 100644 --- a/dbus/BUILD.gn +++ b/dbus/BUILD.gn @@ -102,8 +102,6 @@ test("dbus_unittests") { ] configs += [ "//build/config/linux/dbus" ] - - data_deps = [ "//testing/buildbot/filters:dbus_unittests_filters" ] } executable("dbus_test_server") { diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index f1cf3ed1728b4f..32c1c889e754d3 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json @@ -6225,8 +6225,7 @@ "--no-xvfb", "--use-weston", "--ozone-platform=wayland", - "--enable-features=UseOzonePlatform", - "--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.dbus_unittests_wayland.filter" + "--enable-features=UseOzonePlatform" ], "merge": { "args": [], diff --git a/testing/buildbot/filters/BUILD.gn b/testing/buildbot/filters/BUILD.gn index 42e7696e38be40..0988f2a6e74814 100644 --- a/testing/buildbot/filters/BUILD.gn +++ b/testing/buildbot/filters/BUILD.gn @@ -124,13 +124,6 @@ source_set("content_unittests_filters") { data = [ "//testing/buildbot/filters/webrtc.content_unittests.filter" ] } -source_set("dbus_unittests_filters") { - testonly = true - - data = - [ "//testing/buildbot/filters/ozone-linux.dbus_unittests_wayland.filter" ] -} - source_set("sync_integration_tests_filters") { testonly = true diff --git a/testing/buildbot/filters/ozone-linux.dbus_unittests_wayland.filter b/testing/buildbot/filters/ozone-linux.dbus_unittests_wayland.filter deleted file mode 100644 index 75956b6da6cd6d..00000000000000 --- a/testing/buildbot/filters/ozone-linux.dbus_unittests_wayland.filter +++ /dev/null @@ -1,5 +0,0 @@ -# TODO(https://crbug.com/1184129). dbus daemon requires X11 display. Figure out how to launch -# dbus with Wayland. Thus, disable all the dbus tests now (it's easier to disable them via a filter -# rather than having a separate gtests matrix of tests). -# Error message is "Unable to autolaunch a dbus-daemon without a $DISPLAY for X11". --* \ No newline at end of file diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index fa8007c8189844..d2cc63d9965f96 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl @@ -1259,16 +1259,6 @@ }, }, }, - 'dbus_unittests_wayland': { - 'modifications': { - # CI Ozone/Wayland tester. - 'Linux Tester (Ozone Wayland)': { - 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.dbus_unittests_wayland.filter', - ], - }, - } - }, 'depth_capture_tests': { # TODO(https://crbug.com/850107): Remove the Android FYI Release (Pixel 2) # exception once there is enough capacity to run these tests. diff --git a/testing/xvfb.py b/testing/xvfb.py index b13bc036be6b18..9596383fc66dee 100755 --- a/testing/xvfb.py +++ b/testing/xvfb.py @@ -243,6 +243,8 @@ def _run_with_weston(cmd, env, stdoutfile): signal.signal(signal.SIGTERM, raise_weston_error) signal.signal(signal.SIGINT, raise_weston_error) + dbus_pid = launch_dbus(env) + # The bundled weston (//third_party/weston) is used by Linux Ozone Wayland # CI and CQ testers and compiled by //ui/ozone/platform/wayland whenever # there is a dependency on the Ozone/Wayland and use_bundled_weston is set @@ -302,6 +304,11 @@ def _run_with_weston(cmd, env, stdoutfile): finally: kill(weston_proc, 'weston') + # dbus-daemon is not a subprocess, so we can't SIGTERM+waitpid() on it. + # To ensure it exits, use SIGKILL which should be safe since all other + # processes that it would have been servicing have exited. + if dbus_pid: + os.kill(dbus_pid, signal.SIGKILL) def _get_display_from_weston(weston_proc_pid): """Retrieves $WAYLAND_DISPLAY set by Weston.