⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 90165 in webkit


Ignore:
Timestamp:
Jun 30, 2011, 2:49:42 PM (15 years ago)
Author:
Adam Roben
Message:

Make TestFaiulres only load old-results directories as needed

Fixes <http://webkit.org/b/63752> Tester pages on TestFailures page load very slowly

Reviewed by Anders Carlsson.

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

(Builder.prototype.getBuildNames): Moved up into the API section of the class. Now just
calls through to _getBuildNamesFromResultsDirectory.
(Builder.prototype.getOldBuildNames): Added. Just calls through to
_getBuildNamesFromResultsDirectory.
(Builder.prototype._getBuildNamesFromResultsDirectory): Renamed from getBuildNames. Now
takes the directory URL as an argument and only fetches that single URL.

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

(LayoutTestHistoryAnalyzer.prototype.start): Moved most logic to _analyzeBuilds. First
analyzes builds from Builder.getBuildNames, then from Builder.getOldBuildNames if needed.
(LayoutTestHistoryAnalyzer.prototype._analyzeBuilds): Moved logic here from start. (Most
changes are just indentation.) Now takes a callback to call when we've finished analyzing
all builds in buildNames so that we can try to fetch more build names if needed.

Location:
trunk/Tools
Files:
3 edited

Legend:

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

    r90120 r90165  
    5858    },
    5959
     60    getBuildNames: function(callback) {
     61        this._getBuildNamesFromResultsDirectory(this.buildbot.baseURL + 'results/' + this.name, callback);
     62    },
     63
    6064    getMostRecentCompletedBuildNumber: function(callback) {
    6165        var cacheKey = 'getMostRecentCompletedBuildNumber';
     
    147151    },
    148152
     153    getOldBuildNames: function(callback) {
     154        this._getBuildNamesFromResultsDirectory(this.buildbot.baseURL + 'old-results/' + this.name, callback);
     155    },
     156
    149157    resultsDirectoryURL: function(buildName) {
    150158        return this.buildbot.resultsDirectoryURL(this.name, buildName);
     
    170178    },
    171179
    172     getBuildNames: function(callback) {
    173         var cacheKey = '_getBuildNames';
     180    _getBuildNamesFromResultsDirectory: function(directoryURL, callback) {
     181        var cacheKey = '_getBuildNamesFromResultsDirectory.' + directoryURL;
    174182        if (cacheKey in this._cache) {
    175183            callback(this._cache[cacheKey]);
     
    193201        }
    194202
    195         getResource(self.buildbot.baseURL + 'results/' + self.name, function(xhr) {
    196             // FIXME: It would be better for performance if we could avoid loading old-results until needed.
    197             getResource(self.buildbot.baseURL + 'old-results/' + self.name, function(oldXHR) {
    198                 var buildNames = buildNamesFromDirectoryXHR(xhr).concat(buildNamesFromDirectoryXHR(oldXHR));
    199                 self._cache[cacheKey] = buildNames;
    200                 callback(buildNames);
    201             });
     203        getResource(directoryURL, function(xhr) {
     204            var buildNames = buildNamesFromDirectoryXHR(xhr);
     205            self._cache[cacheKey] = buildNames;
     206            callback(buildNames);
    202207        });
    203208    },
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js

    r90114 r90165  
    7070        var self = this;
    7171        self._builder.getBuildNames(function(buildNames) {
    72             function inner(buildIndex) {
    73                 self._incorporateBuildHistory(buildNames, buildIndex, function(callAgain) {
    74                     var nextIndex = buildIndex + 1;
    75                     if (nextIndex >= buildNames.length)
    76                         callAgain = false;
    77                     var data = {
    78                         history: self._history,
    79                         possiblyFlaky: {},
    80                     };
    81                     self._flakinessDetector.possiblyFlakyTests.forEach(function(testName) {
    82                         data.possiblyFlaky[testName] = self._flakinessDetector.flakinessExamples(testName);
    83                     });
    84                     var callbackRequestedStop = !callback(data, callAgain);
    85                     if (callbackRequestedStop || !callAgain)
    86                         return;
    87                     setTimeout(function() { inner(nextIndex) }, 0);
     72            self._analyzeBuilds(buildNames, callback, function() {
     73                self._builder.getOldBuildNames(function(oldBuildNames) {
     74                    self._analyzeBuilds(oldBuildNames, callback);
    8875                });
    89             }
    90             inner(0);
     76            });
    9177        });
     78    },
     79
     80    _analyzeBuilds: function(buildNames, callback, analyzedAllBuildsCallback) {
     81        var self = this;
     82        function inner(buildIndex) {
     83            self._incorporateBuildHistory(buildNames, buildIndex, function(callAgain) {
     84                var data = {
     85                    history: self._history,
     86                    possiblyFlaky: {},
     87                };
     88                self._flakinessDetector.possiblyFlakyTests.forEach(function(testName) {
     89                    data.possiblyFlaky[testName] = self._flakinessDetector.flakinessExamples(testName);
     90                });
     91
     92                var nextIndex = buildIndex + 1;
     93                var analyzedAllBuilds = nextIndex >= buildNames.length;
     94                var haveMoreDataToFetch = !analyzedAllBuilds || analyzedAllBuildsCallback;
     95
     96                var callbackRequestedStop = !callback(data, haveMoreDataToFetch);
     97                if (callbackRequestedStop)
     98                    return;
     99
     100                if (analyzedAllBuilds) {
     101                    if (analyzedAllBuildsCallback)
     102                        analyzedAllBuildsCallback();
     103                    return;
     104                }
     105
     106                setTimeout(function() { inner(nextIndex) }, 0);
     107            });
     108        }
     109        inner(0);
    92110    },
    93111
  • trunk/Tools/ChangeLog

    r90163 r90165  
     12011-06-30  Adam Roben  <aroben@apple.com>
     2
     3        Make TestFaiulres only load old-results directories as needed
     4
     5        Fixes <http://webkit.org/b/63752> Tester pages on TestFailures page load very slowly
     6
     7        Reviewed by Anders Carlsson.
     8
     9        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder.js:
     10        (Builder.prototype.getBuildNames): Moved up into the API section of the class. Now just
     11        calls through to _getBuildNamesFromResultsDirectory.
     12        (Builder.prototype.getOldBuildNames): Added. Just calls through to
     13        _getBuildNamesFromResultsDirectory.
     14        (Builder.prototype._getBuildNamesFromResultsDirectory): Renamed from getBuildNames. Now
     15        takes the directory URL as an argument and only fetches that single URL.
     16
     17        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js:
     18        (LayoutTestHistoryAnalyzer.prototype.start): Moved most logic to _analyzeBuilds. First
     19        analyzes builds from Builder.getBuildNames, then from Builder.getOldBuildNames if needed.
     20        (LayoutTestHistoryAnalyzer.prototype._analyzeBuilds): Moved logic here from start. (Most
     21        changes are just indentation.) Now takes a callback to call when we've finished analyzing
     22        all builds in buildNames so that we can try to fetch more build names if needed.
     23
    1242011-06-30  Mark Rowe  <mrowe@apple.com>
    225
Note: See TracChangeset for help on using the changeset viewer.