Changeset 93016 in webkit


Ignore:
Timestamp:
Aug 13, 2011 8:39:03 AM (13 years ago)
Author:
Dimitri Glazkov
Message:

garden-o-matic's analyzeUnexpectedFailures needs a completion callback.
https://bugs.webkit.org/show_bug.cgi?id=66166

Also changed base.RequestTracker to:
a) fire callback immediately if requestsInFlight is 0;
b) not barf if callback is not supplied.

Reviewed by Adam Barth.

  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js: Started using completion callback.
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/model.js: Added completion callback.
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/base.js: Changed RequestTracker.
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/base_unittest.js: Added unit tests.
Location:
trunk/Tools
Files:
5 edited

Legend:

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

    r92972 r93016  
    112112    this._callback = callback;
    113113    this._args = args || [];
    114 };
    115 
    116 base.RequestTracker.prototype.requestComplete = function()
    117 {
    118     --this._requestsInFlight;
    119     if (!this._requestsInFlight)
    120         this._callback.apply(null, this._args);
    121 };
     114    this._tryCallback();
     115};
     116
     117base.RequestTracker.prototype = {
     118    _tryCallback: function()
     119    {
     120        if (!this._requestsInFlight && this._callback)
     121            this._callback.apply(null, this._args);
     122    },
     123    requestComplete: function()
     124    {
     125        --this._requestsInFlight;
     126        this._tryCallback();
     127    }
     128}
    122129
    123130base.callInParallel = function(functionList, callback)
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/base_unittests.js

    r92972 r93016  
    114114});
    115115
    116 test("RequestTracker", 3, function() {
     116test("RequestTracker", 5, function() {
    117117    var ready = false;
    118118    var tracker = new base.RequestTracker(1, function() {
     
    133133
    134134    tracker = new base.RequestTracker(0, function() {
    135         ok(false);
    136     });
    137     tracker.requestComplete();
     135        ok(true);
     136    });
     137    tracker.requestComplete();
     138
     139    tracker = new base.RequestTracker(0);
     140    tracker.requestComplete();
     141    // Should not barf.
     142    ok(true);
    138143});
    139144
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js

    r92886 r93016  
    288288        showRecentCommits();
    289289        showBuilderProgress();
    290         model.analyzeUnexpectedFailures(showUnexpectedFailure);
    291         dismissButterbar();
     290        model.analyzeUnexpectedFailures(showUnexpectedFailure, dismissButterbar);
    292291        checkForLocalServer();
    293292    });
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/model.js

    r92886 r93016  
    115115};
    116116
    117 model.analyzeUnexpectedFailures = function(callback)
     117model.analyzeUnexpectedFailures = function(callback, completionCallback)
    118118{
    119119    var unexpectedFailures = results.unexpectedFailuresByTest(model.state.resultsByBuilder);
     
    124124    });
    125125
     126    var tracker = new base.RequestTracker(Object.keys(unexpectedFailures).length, completionCallback);
    126127    $.each(unexpectedFailures, function(testName, resultNodesByBuilder) {
    127128        var builderNameList = base.keys(resultNodesByBuilder);
     
    146147            model.state.failureAnalysisByTest[testName] = failureAnalysis;
    147148            callback(failureAnalysis);
     149            tracker.requestComplete();
    148150        });
    149151    });
  • trunk/Tools/ChangeLog

    r93005 r93016  
     12011-08-13  Dimitri Glazkov  <dglazkov@chromium.org>
     2
     3        garden-o-matic's analyzeUnexpectedFailures needs a completion callback.
     4        https://bugs.webkit.org/show_bug.cgi?id=66166
     5
     6        Also changed base.RequestTracker to:
     7        a) fire callback immediately if requestsInFlight is 0;
     8        b) not barf if callback is not supplied.
     9
     10        Reviewed by Adam Barth.
     11
     12        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js: Started using completion callback.
     13        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/model.js: Added completion callback.
     14        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/base.js: Changed RequestTracker.
     15        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/base_unittest.js: Added unit tests.
     16
    1172011-08-12  Mark Rowe  <mrowe@apple.com>
    218
Note: See TracChangeset for help on using the changeset viewer.