Bug 175126 - REGRESSION(r219850): run-benchmark script broken on Linux
Summary: REGRESSION(r219850): run-benchmark script broken on Linux
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Carlos Alberto Lopez Perez
URL:
Keywords: InRadar
Depends on:
Blocks: 174445
  Show dependency treegraph
 
Reported: 2017-08-03 04:32 PDT by Carlos Alberto Lopez Perez
Modified: 2017-08-03 18:14 PDT (History)
10 users (show)

See Also:


Attachments
Patch (5.29 KB, patch)
2017-08-03 04:40 PDT, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff
Patch (6.74 KB, patch)
2017-08-03 16:58 PDT, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Lopez Perez 2017-08-03 04:32:51 PDT
The run-benchmark script dynamically generates the list of supported browsers and platforms (currently linux and osx) by loading all python files from Tools/Scripts/webkitpy/benchmark_runner/browser_driver and getting the browser_name and platform variables from the classes defined there.

This means, that this classes should never raise an exception when loaded on other platforms or otherwise they will broke the whole script. Its fine if they raise an exception when executing on any of the methods they implement, but not when just loading/importing the class.

So, yo avoid raising exceptions on another platforms we load the python modules that are platform specific on the functions rather than on the main file or the main class body. Example: https://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/linux_browser_driver.py?rev=216213#L110

On r219850 <https://trac.webkit.org/r219850> a method for _screen_size() was added also for the OSX platform, but this method is called from the main file so its evaluated when the load of the classes is done to get the lists of platforms an browsers. Therefore it aborts on Linux like this:

https://build.webkit.org/builders/GTK%20Linux%2064-bit%20Release%20%28Perf%29/builds/850/steps/benchmark-test/logs/stdio
Comment 1 Carlos Alberto Lopez Perez 2017-08-03 04:40:40 PDT
Created attachment 317111 [details]
Patch
Comment 2 Matthew Stewart 2017-08-03 14:17:28 PDT
Comment on attachment 317111 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=317111&action=review

> Tools/Scripts/webkitpy/benchmark_runner/browser_driver/osx_chrome_driver.py:17
> +        window_size_arg = '--window-size={width},{height}'.format(width=int(OSXBrowserDriver._screen_size().width), height=int(OSXBrowserDriver._screen_size().height))

Add this line inside create_chrome_options() as well
Comment 3 Stephanie Lewis 2017-08-03 14:43:38 PDT
Comment on attachment 317111 [details]
Patch

Sorry for the breakage.  Rather than copying the code everywhere can we just create get_screen_size_method in browser_driver than OSX implements.  We should have done that in the first place
Comment 4 Stephanie Lewis 2017-08-03 14:53:33 PDT
I didn't think that one through all the way.  I still think thats a long line to duplicate but that's irrelevant to the issue at hand.  If one of you upload a patch with the change Matthew requested I'll r+ it
Comment 5 Carlos Alberto Lopez Perez 2017-08-03 16:36:08 PDT
(In reply to Stephanie Lewis from comment #3)
> Comment on attachment 317111 [details]
> Patch
> 
> Sorry for the breakage.  Rather than copying the code everywhere can we just
> create get_screen_size_method in browser_driver than OSX implements.  We
> should have done that in the first place

There is already a _screen_size() method in osx_browser_driver.

I will try to use a create_args() function on this firefox and chrome files to avoid duplicating code.

Patch incoming soon
Comment 6 Carlos Alberto Lopez Perez 2017-08-03 16:58:06 PDT
Created attachment 317182 [details]
Patch
Comment 7 Matthew Stewart 2017-08-03 17:10:54 PDT
Looks good to me!
Comment 8 WebKit Commit Bot 2017-08-03 18:12:57 PDT
Comment on attachment 317182 [details]
Patch

Clearing flags on attachment: 317182

Committed r220246: <http://trac.webkit.org/changeset/220246>
Comment 9 WebKit Commit Bot 2017-08-03 18:12:59 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2017-08-03 18:14:12 PDT
<rdar://problem/33714151>