Changeset 90747 in webkit


Ignore:
Timestamp:
Jul 11, 2011 8:27:05 AM (13 years ago)
Author:
Adam Roben
Message:

Teach TestFailures that ORWT's results.html file might be missing due to all tests passing

There are three reasons why we might fail to fetch ORWT's results.html:

  • All tests passed, so no results.html was generated
  • Some error during the test run caused results.html not to be generated (e.g., ORWT timed out)
  • Some network error occurred when fetching results.html

We were failing to account for the first possibility in some cases. For test runs before
r89610, we first check build.webkit.org/json to determine how many tests failed and whether
ORWT exited early due to too many failures; if all tests passed then we don't fetch
results.html at all. r89610 changed ORWT to put information in results.html about exiting
early due to too many failures, so we no longer needed to check build.webkit.org/json to get
that information, and in r89619 I changed TestFailures to do just that. But I forgot that we
still needed to check build.webkit.org/json to find out if all tests passed!

Now, for test runs after r89610, we check results.html first, and then check
build.webkit.org/json if we fail to fetch results.html. This lets us distinguish between all
tests passing and the error cases.

Fixes <http://webkit.org/b/64280> TestFailures page can't pinpoint that r90699 caused 13
tests to fail on Windows 7 Release (WebKit2 Tests)

Reviewed by David Kilzer.

  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js:

(LayoutTestResultsLoader.prototype.start): Bumped the cache version so that old, buggy
cached data will get evicted. We were marking builds where all tests passed as errors!
(LayoutTestResultsLoader.prototype._fetchAndParseORWTResults): Added success/error callback
parameters to the fetchAndParseResultsHTML helper function, and added a similar
fetchNumberOfFailingTests function that fetches data from build.webkit.org/json (code came
from later in the function). For test runs before r89610, we first check
build.webkit.org/json then check results.html. For builds after r89610, we first check
results.html and then check build.webkit.org/json if we couldn't fetch results.html.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js

    r90656 r90747  
    3131    start: function(buildName, callback, errorCallback) {
    3232        var cacheKey = 'LayoutTestResultsLoader.' + this._builder.name + '.' + buildName;
    33         const currentCachedDataVersion = 3;
     33        const currentCachedDataVersion = 4;
    3434        if (PersistentCache.contains(cacheKey)) {
    3535            var cachedData = PersistentCache.get(cacheKey);
     
    8383        var self = this;
    8484
    85         function fetchAndParseResultsHTMLAndCallCallback() {
     85        function fetchAndParseResultsHTML(successCallback, errorCallback) {
    8686            getResource(self._builder.resultsPageURL(buildName), function(xhr) {
    8787                var parseResult = (new ORWTResultsParser()).parse(xhr.responseText);
     
    8989                if (resultsHTMLSupportsTooManyFailuresInfo)
    9090                    result.tooManyFailures = parseResult.tooManyFailures;
    91 
    92                 successCallback(result);
     91                successCallback();
    9392            },
    9493            function(xhr) {
    95                 // We failed to fetch results.html. run-webkit-tests must have aborted early.
     94                // We failed to fetch results.html.
    9695                errorCallback();
    9796            });
    9897        }
    9998
     99        function fetchNumberOfFailingTests(successCallback, errorCallback) {
     100            self._builder.getNumberOfFailingTests(parsedBuildName.buildNumber, function(failingTestCount, tooManyFailures) {
     101                result.tooManyFailures = tooManyFailures;
     102
     103                if (failingTestCount < 0) {
     104                    // The number of failing tests couldn't be determined.
     105                    errorCallback();
     106                    return;
     107                }
     108
     109                successCallback(failingTestCount);
     110            });
     111        }
     112
    100113        if (resultsHTMLSupportsTooManyFailuresInfo) {
    101             fetchAndParseResultsHTMLAndCallCallback();
     114            fetchAndParseResultsHTML(function() {
     115                successCallback(result);
     116            },
     117            function() {
     118                fetchNumberOfFailingTests(function(failingTestCount) {
     119                    if (!failingTestCount) {
     120                        // All tests passed, so no results.html was generated.
     121                        successCallback(result);
     122                        return;
     123                    }
     124
     125                    // Something went wrong with fetching results.
     126                    errorCallback();
     127                }, errorCallback);
     128            });
    102129            return;
    103130        }
    104131
    105         self._builder.getNumberOfFailingTests(parsedBuildName.buildNumber, function(failingTestCount, tooManyFailures) {
    106             result.tooManyFailures = tooManyFailures;
    107 
    108             if (failingTestCount < 0) {
    109                 // The number of failing tests couldn't be determined.
    110                 errorCallback();
    111                 return;
    112             }
    113 
     132        fetchNumberOfFailingTests(function(failingTestCount) {
    114133            if (!failingTestCount) {
    115134                // All tests passed.
     
    119138
    120139            // Find out which tests failed.
    121             fetchAndParseResultsHTMLAndCallCallback();
    122         });
     140            fetchAndParseResultsHTML(function() {
     141                successCallback(result);
     142            }, errorCallback);
     143        }, errorCallback);
    123144    },
    124145};
  • trunk/Tools/ChangeLog

    r90746 r90747  
     12011-07-11  Adam Roben  <aroben@apple.com>
     2
     3        Teach TestFailures that ORWT's results.html file might be missing due to all tests passing
     4
     5        There are three reasons why we might fail to fetch ORWT's results.html:
     6          - All tests passed, so no results.html was generated
     7          - Some error during the test run caused results.html not to be generated (e.g., ORWT
     8            timed out)
     9          - Some network error occurred when fetching results.html
     10
     11        We were failing to account for the first possibility in some cases. For test runs before
     12        r89610, we first check build.webkit.org/json to determine how many tests failed and whether
     13        ORWT exited early due to too many failures; if all tests passed then we don't fetch
     14        results.html at all. r89610 changed ORWT to put information in results.html about exiting
     15        early due to too many failures, so we no longer needed to check build.webkit.org/json to get
     16        that information, and in r89619 I changed TestFailures to do just that. But I forgot that we
     17        still needed to check build.webkit.org/json to find out if all tests passed!
     18
     19        Now, for test runs after r89610, we check results.html first, and then check
     20        build.webkit.org/json if we fail to fetch results.html. This lets us distinguish between all
     21        tests passing and the error cases.
     22
     23        Fixes <http://webkit.org/b/64280> TestFailures page can't pinpoint that r90699 caused 13
     24        tests to fail on Windows 7 Release (WebKit2 Tests)
     25
     26        Reviewed by David Kilzer.
     27
     28        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js:
     29        (LayoutTestResultsLoader.prototype.start): Bumped the cache version so that old, buggy
     30        cached data will get evicted. We were marking builds where all tests passed as errors!
     31        (LayoutTestResultsLoader.prototype._fetchAndParseORWTResults): Added success/error callback
     32        parameters to the fetchAndParseResultsHTML helper function, and added a similar
     33        fetchNumberOfFailingTests function that fetches data from build.webkit.org/json (code came
     34        from later in the function). For test runs before r89610, we first check
     35        build.webkit.org/json then check results.html. For builds after r89610, we first check
     36        results.html and then check build.webkit.org/json if we couldn't fetch results.html.
     37
    1382011-07-11  Csaba Osztrogonác  <ossy@webkit.org>
    239
Note: See TracChangeset for help on using the changeset viewer.