RESOLVED FIXED 76802
run-perf-tests should report server-side errors
https://bugs.webkit.org/show_bug.cgi?id=76802
Summary run-perf-tests should report server-side errors
Ryosuke Niwa
Reported 2012-01-22 18:16:06 PST
webkit-perf.appspot.com may reject uploaded jsons for reasons other than network errors. e.g. malformed data. run-perf-tests should report those errors.
Attachments
fixes the bug (6.25 KB, patch)
2012-01-22 19:24 PST, Ryosuke Niwa
no flags
Fixed the bug pointed out by Tony (6.27 KB, patch)
2012-01-23 13:33 PST, Ryosuke Niwa
no flags
Ryosuke Niwa
Comment 1 2012-01-22 19:24:10 PST
Created attachment 123509 [details] fixes the bug
Tony Chang
Comment 2 2012-01-23 09:47:30 PST
Comment on attachment 123509 [details] fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=123509&action=review > Tools/Scripts/webkitpy/common/net/file_uploader.py:116 > - NetworkTransaction(timeout_seconds=self._timeout_seconds).run(callback) > + response = NetworkTransaction(timeout_seconds=self._timeout_seconds).run(callback) > finally: > socket.setdefaulttimeout(orig_timeout) > + return response Do we need to define response outside of the try? Otherwise if response doesn't get set, you'll get an UnboundLocalError exception. > Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py:183 > + response_body = [line.strip('\n') for line in response] > + if response_body != ['OK']: Can you just check for response.strip('\n') == 'OK'?
Ryosuke Niwa
Comment 3 2012-01-23 11:03:04 PST
Comment on attachment 123509 [details] fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=123509&action=review >> Tools/Scripts/webkitpy/common/net/file_uploader.py:116 >> + return response > > Do we need to define response outside of the try? Otherwise if response doesn't get set, you'll get an UnboundLocalError exception. Oops, yes, I should set it to None. It's very annoying that we can't create a unit test for this function :( >> Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py:183 >> + if response_body != ['OK']: > > Can you just check for response.strip('\n') == 'OK'? response is a file-like object so not sure if we can do that. I was initially fetching only the first line but then it didn't really matter because the for-loop terminates after one iteration when the response is just 'OK' and we have to read the entire response otherwise anyways.
Tony Chang
Comment 4 2012-01-23 11:08:57 PST
Comment on attachment 123509 [details] fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=123509&action=review >>> Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py:183 >>> + if response_body != ['OK']: >> >> Can you just check for response.strip('\n') == 'OK'? > > response is a file-like object so not sure if we can do that. I was initially fetching only the first line but then it didn't really matter because the for-loop terminates after one iteration when the response is just 'OK' and we have to read the entire response otherwise anyways. You could do response.read().strip('\n') and store that in a variable. I guess that's about the same amount of code. *shrug*
Ryosuke Niwa
Comment 5 2012-01-23 11:23:39 PST
Comment on attachment 123509 [details] fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=123509&action=review >>>> Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py:183 >>>> + if response_body != ['OK']: >>> >>> Can you just check for response.strip('\n') == 'OK'? >> >> response is a file-like object so not sure if we can do that. I was initially fetching only the first line but then it didn't really matter because the for-loop terminates after one iteration when the response is just 'OK' and we have to read the entire response otherwise anyways. > > You could do response.read().strip('\n') and store that in a variable. I guess that's about the same amount of code. *shrug* But then I'd have to store that value when it doesn't match 'OK' or else I'd have to manually seek back (not even sure if we can do that on the response).
Ryosuke Niwa
Comment 6 2012-01-23 13:33:27 PST
Created attachment 123611 [details] Fixed the bug pointed out by Tony
Dirk Pranke
Comment 7 2012-01-23 13:48:27 PST
Comment on attachment 123611 [details] Fixed the bug pointed out by Tony View in context: https://bugs.webkit.org/attachment.cgi?id=123611&action=review change looks fine to me but I'll let tony r+ it. > Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py:183 > + if response_body != ['OK']: Minor nit: why not just delete 182 and change 183 to <code>if response_body != ['OK\n']:</code>?
Ryosuke Niwa
Comment 8 2012-01-23 13:51:42 PST
Comment on attachment 123611 [details] Fixed the bug pointed out by Tony View in context: https://bugs.webkit.org/attachment.cgi?id=123611&action=review >> Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py:183 >> + if response_body != ['OK']: > > Minor nit: why not just delete 182 and change 183 to <code>if response_body != ['OK\n']:</code>? If I do that, then I'd have to call stip on each line when we output the error.
Dirk Pranke
Comment 9 2012-01-23 13:53:08 PST
Comment on attachment 123611 [details] Fixed the bug pointed out by Tony View in context: https://bugs.webkit.org/attachment.cgi?id=123611&action=review >>> Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py:183 >>> + if response_body != ['OK']: >> >> Minor nit: why not just delete 182 and change 183 to <code>if response_body != ['OK\n']:</code>? > > If I do that, then I'd have to call stip on each line when we output the error. Ah, fair enough.
Ryosuke Niwa
Comment 10 2012-01-23 15:49:02 PST
Comment on attachment 123611 [details] Fixed the bug pointed out by Tony Clearing flags on attachment: 123611 Committed r105650: <http://trac.webkit.org/changeset/105650>
Ryosuke Niwa
Comment 11 2012-01-23 15:49:07 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.