Bug 90243 - garden-o-matic broken: TypeError: 'undefined' is not an object (evaluating 'buildLocations[currentIndex].url')
Summary: garden-o-matic broken: TypeError: 'undefined' is not an object (evaluating 'b...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ojan Vafai
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-28 20:44 PDT by Simon Fraser (smfr)
Modified: 2012-06-29 20:37 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.94 KB, patch)
2012-06-29 16:53 PDT, Ojan Vafai
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2012-06-28 20:44:50 PDT
Loading http://build.webkit.org/TestFailures/garden-o-matic.html?platform=apple, I get:
TypeError: 'undefined' is not an object (evaluating 'buildLocations[currentIndex].url')
and it never gets past Loading commit data ...
Comment 1 Simon Fraser (smfr) 2012-06-28 21:08:17 PDT
I'm seeing parse errors from net.jsonp for full_results.json files. If I try to validate them, validation fails with the ADD_RESULTS() stuff. How did this ever work?
Comment 2 Simon Fraser (smfr) 2012-06-28 21:09:41 PDT
Also, the mac testers can now do testing out of order, so we can't just go by build number, and assume that the most recent build is the most recent revision.
Comment 3 Adam Barth 2012-06-28 22:37:38 PDT
net.jsonp strips out the ADD_RESULTS part of the response.
Comment 4 Ojan Vafai 2012-06-28 23:21:14 PDT
(In reply to comment #1)
> I'm seeing parse errors from net.jsonp for full_results.json files. If I try to validate them, validation fails with the ADD_RESULTS() stuff. How did this ever work?

Are you sure you diagnosed this right? I'm not seeing parse errors. I get an error on line 629 of results.js:
net.jsonp(buildLocations[currentIndex].url, resultsCallback);
Uncaught TypeError: Cannot read property 'url' of undefined 

So, somehow currentIndex is exceeding the bounds of buildLocations. This is the call that fetches full_results.json.
Comment 5 Ojan Vafai 2012-06-28 23:21:57 PDT
Also, I'm looking at http://trac.webkit.org/export/HEAD/trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html?platform=apple since http://build.webkit.org/TestFailures isn't always up to date. I'm not really sure how/when that gets pushed.
Comment 6 Ojan Vafai 2012-06-28 23:24:36 PDT
Ugh. Sorry, I spoke before understanding the code in question. Ignore me. :(
Comment 7 Ojan Vafai 2012-06-28 23:35:29 PDT
That all said, I can't figure out what's going wrong here. It looks like we never hit the success clause in net.jsonp, but I can see in the inspector the some full_results.json requests are returning 200s with valid data.
Comment 8 Simon Fraser (smfr) 2012-06-29 08:58:27 PDT
(In reply to comment #7)
> That all said, I can't figure out what's going wrong here. It looks like we never hit the success clause in net.jsonp, but I can see in the inspector the some full_results.json requests are returning 200s with valid data.

I understand why we can walk off the end of buildLocations.

But I was seeing net.jsonp report parseErrors when fetching full_results.jsonp, so it was able to download results from the server, but all the results files failed to parse. That's why it hit the end of the list of buildLocations.
Comment 9 Simon Fraser (smfr) 2012-06-29 11:34:35 PDT
Oddly I don't see the same issue on my work machine (or something was fixed overnight).
Comment 10 Ojan Vafai 2012-06-29 15:16:13 PDT
I'm pretty sure jQuery's ajax library is doing something crazy here. If I break in the error handler of $.ajax, I get a "parsererror" error. But if I look at the responseText, it's perfectly valid JSONP as best I can tell. jquery shouldn't even know that this is supposed to be json though. Maybe it's trying to parse the content as json for some reason?
Comment 11 Ojan Vafai 2012-06-29 15:19:00 PDT
Found the problem. Not sure how this ever worked.

http://api.jquery.com/jQuery.ajax/

dataType
Default: Intelligent Guess (xml, json, script, or html)
The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response..."json": Evaluates the response as JSON and returns a JavaScript object. In jQuery 1.4 the JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. (See json.org for more information on proper JSON formatting.)

I think setting the dataType to jsonp might fix this. Or, we could just use XHR directly. We don't actually need any of jquery's magic here. We're just using it for onload/onerror anyways.
Comment 12 Adam Barth 2012-06-29 15:20:39 PDT
+1 for using XHR directly.  We started out using jQuery but now regret it.
Comment 13 Ojan Vafai 2012-06-29 16:53:54 PDT
Created attachment 150274 [details]
Patch
Comment 14 Ojan Vafai 2012-06-29 16:54:38 PDT
FWIW, I would guess that a server-side change to the content-type of the json files is what broke this.
Comment 15 WebKit Review Bot 2012-06-29 20:37:08 PDT
Comment on attachment 150274 [details]
Patch

Clearing flags on attachment: 150274

Committed r121617: <http://trac.webkit.org/changeset/121617>
Comment 16 WebKit Review Bot 2012-06-29 20:37:13 PDT
All reviewed patches have been landed.  Closing bug.