WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
96453
run-perf-tests output cryptic error when the config file is missing.
https://bugs.webkit.org/show_bug.cgi?id=96453
Summary
run-perf-tests output cryptic error when the config file is missing.
Stephanie Lewis
Reported
2012-09-11 17:55:20 PDT
The error occurred after all the test finished running and it was: Failed to merge source JSON file ../../perf-test-config.json: [Errno 2] No such file or directory: '../../perf-test-config.json' which most people took to mean the tests were failing to run correctly.
Attachments
Improve error and help messages for source JSON files
(11.23 KB, patch)
2012-09-13 14:29 PDT
,
Ryosuke Niwa
no flags
Details
Formatted Diff
Diff
Fixed one typo
(11.24 KB, patch)
2012-09-13 14:32 PDT
,
Ryosuke Niwa
tony
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Ryosuke Niwa
Comment 1
2012-09-13 14:29:45 PDT
Created
attachment 163966
[details]
Improve error and help messages for source JSON files
Ryosuke Niwa
Comment 2
2012-09-13 14:32:51 PDT
Created
attachment 163968
[details]
Fixed one typo
Tony Chang
Comment 3
2012-09-13 14:46:13 PDT
Comment on
attachment 163968
[details]
Fixed one typo View in context:
https://bugs.webkit.org/attachment.cgi?id=163968&action=review
> Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py:224 > + slave_config_json = self._host.filesystem.open_text_file_for_reading(slave_config_json_path)
Nit: Should we move this line out of the try block now?
> Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py:226 > + return dict(slave_config.items() + output.items())
Nit: I would probably also move this line out of the try as well and make the Exception clear that it's a JSON error.
Ryosuke Niwa
Comment 4
2012-09-13 14:50:04 PDT
Comment on
attachment 163968
[details]
Fixed one typo View in context:
https://bugs.webkit.org/attachment.cgi?id=163968&action=review
>> Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py:224 >> + slave_config_json = self._host.filesystem.open_text_file_for_reading(slave_config_json_path) > > Nit: Should we move this line out of the try block now?
I think codecs.open can still throw exceptions. e.g. slave_config_json_path can be a file that's not readable by the current user.
>> Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py:226 >> + return dict(slave_config.items() + output.items()) > > Nit: I would probably also move this line out of the try as well and make the Exception clear that it's a JSON error.
No. One of the errors that could happen is that slave_config is an array, string, etc...
Ryosuke Niwa
Comment 5
2012-09-13 14:51:26 PDT
Committed
r128511
: <
http://trac.webkit.org/changeset/128511
>
Tony Chang
Comment 6
2012-09-13 15:22:31 PDT
In general, we should strive to scope try/except blocks as tightly as possible to help identify errors. E.g., if you had a separate try/except for each line, it would be clear what failed (bad file permissions, bad json file (does this even raise?), or bad slave config format).
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug