Summary: | [GTK] The Xvfb display server may fail to start sometimes causing tests to randomly crash | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Carlos Alberto Lopez Perez <clopez> | ||||||||
Component: | Tools / Tests | Assignee: | Carlos Alberto Lopez Perez <clopez> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | bugs-noreply, cgarcia, commit-queue, dewei_zhu, eric.carlson, ews-watchlist, glenn, jbedard, jer.noble, philipj, pnormand, sergio, slewis, webkit-bug-importer, youennf, zdobersek | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=229782 https://bugs.webkit.org/show_bug.cgi?id=229824 https://bugs.webkit.org/show_bug.cgi?id=230610 |
||||||||||
Bug Depends on: | 229990 | ||||||||||
Bug Blocks: | |||||||||||
Attachments: |
|
Description
Carlos Alberto Lopez Perez
2021-09-01 04:33:53 PDT
Looks like this was more common than I expected.. I have been able to reproduce the issue of Xvfb not starting properly locally when testing this. Patch incoming Created attachment 437043 [details]
Patch
EWS is red, python2 test failure: webkitpy.port.xvfbdriver_unittest.XvfbDriverTest.test_xvfb_not_replying I'm all-in-favor for fixing this, but it begs the question, should we soon migrate the bots to wayland and consider X as a legacy thing? Created attachment 437051 [details]
Patch
(In reply to Philippe Normand from comment #3) > EWS is red, python2 test failure: > webkitpy.port.xvfbdriver_unittest.XvfbDriverTest.test_xvfb_not_replying > > I'm all-in-favor for fixing this, but it begs the question, should we soon > migrate the bots to wayland and consider X as a legacy thing? Running on a real wayland display is a major issue because it complicates a lot the hardware maintenance and deployment (makes difficult to use containers, also depending on a specific graphics hardware drivers makes failures less reproducible, etc). I would be all in favour of migrating to wayland if there is a way of having the tests to run in a virtualized wayland environment. Fortunately we have that, currently we can pass --display-server=weston to run-webkit-tests which runs the tests inside weston inside Xvfb. Is a bit hackish but it works. This patch also fixes the startup of Xvfb for the --display-server=weston option (weston in Xvfb--- fixes the Xvfb part). I plan to also fix the weston startup part (likely there are race conditions there as well) on a follow-up patch soon. Then we would need to check how different are the results from the Weston driver compared to the Xvfb one. Also I'm not really found of this solution of Weston inside Xvfb.. if there is a better way of achieving a virtualized display for wayland please let me know that. > if there is a better way of achieving a virtualized display for wayland please let me know that.
Maybe there's a way to run weston in swrast mode? I don't know, I haven't done research in that field :) But yeah it's a bit sad to run weston within xvfb :(
(In reply to Carlos Alberto Lopez Perez from comment #5) > Also I'm not really found of this solution of Weston inside Xvfb.. if there > is a better way of achieving a virtualized display for wayland please let me > know that. I think we can do: $ weston --backend=headless-backend.so If that doesn't work, mutter has a headless mode added in https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698. You could try: $ mutter --wayland --headless --virtual-monitor 1280x720 I know wlroots also has a headless mode. Comment on attachment 437051 [details] Patch Clearing flags on attachment: 437051 Committed r281870 (241200@main): <https://commits.webkit.org/241200@main> All reviewed patches have been landed. Closing bug. This broke GTK API tests :\ ... it seems the GTK API test runner script runs with python2 and the code I added is not working properly there .. I will revert this. Reverted r281870 for reason: It Committed r281874 (241204@main): <https://commits.webkit.org/241204@main> (In reply to Carlos Alberto Lopez Perez from comment #11) > This broke GTK API tests :\ ... it seems the GTK API test runner script runs > with python2 and the code I added is not working properly there .. I will > revert this. On this note, we've started changing invocations of all Apple's Python scripts to Python3. Other ports will get some of this work for free (already happened with run-webkit-tests, for example) but Apple folks won't make that change for scripts we don't own or partially own (In reply to Jonathan Bedard from comment #13) > (In reply to Carlos Alberto Lopez Perez from comment #11) > > This broke GTK API tests :\ ... it seems the GTK API test runner script runs > > with python2 and the code I added is not working properly there .. I will > > revert this. > > On this note, we've started changing invocations of all Apple's Python > scripts to Python3. Other ports will get some of this work for free (already > happened with run-webkit-tests, for example) but Apple folks won't make that > change for scripts we don't own or partially own That's for the note. I think that is fair and makes sense. Thanks for working on this, btw. I opened bug 229782 for porting the GTK/WPE API test runner to python3 Also opened bug 229783 for run-perf-tests I converted run-gtk-tests, run-wpe-tests and run-perf-tests to use python3. But I realized that there are still more scripts running with python2 like run-webdriver-tests and maybe even others which I still didn't realized about. So I will upload now a new version of this patch that is compatible with python2, to not block here on migrating every consumer of it to python3. Created attachment 437409 [details] Patch Make code compatible with python2. This is the diff against the previous patch: http://sprunge.us/BfNZVc?diff Comment on attachment 437409 [details] Patch Clearing flags on attachment: 437409 Committed r282064 (241364@main): <https://commits.webkit.org/241364@main> All reviewed patches have been landed. Closing bug. Re-opened since this is blocked by bug 229990 (In reply to WebKit Commit Bot from comment #19) > Re-opened since this is blocked by bug 229990 An update of what happened here.. On r282064 I messed things up and by mistake I redirected stderr to stdout on the subprocess call to check the screen size of the Xvfb display, so when for any reason the program that checks the size prints anything on stderr (like a gtk/glib warning), then it would mix stderr with stdout and it will make the check fail (since the screen dimensions of the display it reports on stdout are compared with the expected ones) In the reported case this was happening: 04:13:30.337 2 worker/5 Waiting for Xvfb display server to be ready. 04:13:30.338 2 worker/1 The queried Xvfb screen size "(print-screen-size:258): dbind-WARNING **: 04:13:30.304: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-WDVOI6JrL3: No such file or directory 1024x768" does not match the expectation "1024x768". The string """(print-screen-size:258): dbind-WARNING **: 04:13:30.304: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-WDVOI6JrL3: No such file or directory""" should belong only to stderr. This patch on top fixes the issue: http://sprunge.us/r865Ui I will re-land it with the above fix Committed r282082 (241382@main): <https://commits.webkit.org/241382@main> |