Changeset 90824 in webkit


Ignore:
Timestamp:
Jul 12, 2011 10:50:59 AM (13 years ago)
Author:
Adam Roben
Message:

Teach TestFailures to recognize when run-webkit-tests gets killed by buildbot

Fixes <http://webkit.org/b/64358> TestFailures page thinks all tests passed in
http://build.webkit.org/builders/Windows%207%20Release%20(Tests)/builds/14672

Reviewed by Daniel Bates.

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

(Builder.prototype.getNumberOfFailingTests): If run-webkit-tests exited with a non-zero
exit status but we didn't find any failure counts, assume that there was some error that
caused run-webkit-tests to die early (like being killed by buildbot due to a timeout).

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

Added a new test that shows that we get a failingTestCount of -1 when run-webkit-tests dies
early.
(runGetNumberOfFailingTestsTest): Moved most code here from the only pre-existing test in this
file.

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

(LayoutTestResultsLoader.prototype.start): Bump the cache number so old cached data that was
tainted by the bug fixed in this patch will be evicted.

Location:
trunk/Tools
Files:
4 edited

Legend:

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

    r90778 r90824  
    149149            }, 0);
    150150
     151            if (!result.failureCount) {
     152                // run-webkit-tests exited with a non-zero exit status, but we
     153                // didn't find any output about the number of failed tests.
     154                // Something must have gone wrong (e.g., run-webkit-tests timed
     155                // out and was killed by buildbot).
     156                result.failureCount = -1;
     157            }
     158
    151159            PersistentCache.set(cacheKey, result);
    152160            callback(result.failureCount, result.tooManyFailures);
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder_unittests.js

    r90814 r90824  
    2828module("Builder");
    2929
    30 test("getNumberOfFailingTests shouldn't include leaks", 4, function() {
     30function runGetNumberOfFailingTestsTest(jsonData, callback) {
    3131    var mockBuildbot = {};
    3232    mockBuildbot.baseURL = 'http://example.com/';
     
    3737    window.getResource = function(url, successCallback, errorCallback) {
    3838        var mockXHR = {};
    39         mockXHR.responseText = JSON.stringify({
    40             steps: [
    41                 {
    42                     name: 'layout-test',
    43                     isStarted: true,
    44                     results: [
    45                         2,
    46                         [
    47                             "2178 total leaks found!",
    48                             "2 test cases (<1%) had incorrect layout",
    49                             "2 test cases (<1%) crashed",
    50                         ],
    51                     ],
    52                 },
    53             ],
    54         });
     39        mockXHR.responseText = JSON.stringify(jsonData);
    5540
     41        // FIXME: It would be better for this callback to happen
     42        // asynchronously, to match what happens for real requests.
    5643        successCallback(mockXHR);
    5744    };
     
    6653    };
    6754
    68     builder.getNumberOfFailingTests(1, function(failureCount, tooManyFailures) {
    69         equal(failureCount, 4);
    70         equal(tooManyFailures, false);
    71     });
     55    builder.getNumberOfFailingTests(1, callback);
    7256
    7357    window.getResource = realGetResource;
     
    7559    window.PersistentCache = realPersistentCache;
    7660    equal(window.PersistentCache, realPersistentCache);
     61}
     62
     63test("getNumberOfFailingTests shouldn't include leaks", 4, function() {
     64    const jsonData = {
     65        steps: [
     66            {
     67                name: 'layout-test',
     68                isStarted: true,
     69                results: [
     70                    2,
     71                    [
     72                        "2178 total leaks found!",
     73                        "2 test cases (<1%) had incorrect layout",
     74                        "2 test cases (<1%) crashed",
     75                    ],
     76                ],
     77            },
     78        ],
     79    };
     80
     81    runGetNumberOfFailingTestsTest(jsonData, function(failureCount, tooManyFailures) {
     82        equal(failureCount, 4);
     83        equal(tooManyFailures, false);
     84    });
     85});
     86
     87test("getNumberOfFailingTests detects spurious run-webkit-tests failures", 4, function() {
     88    const jsonData = {
     89        steps: [
     90            {
     91                isFinished: true,
     92                isStarted: true,
     93                name: "layout-test",
     94                results: [
     95                    2,
     96                    [
     97                        "layout-test"
     98                    ]
     99                ],
     100                step_number: 7,
     101                text: [
     102                    "layout-test"
     103                ],
     104                times: [
     105                    1310437736.00494,
     106                    1310440118.038023
     107                ],
     108            },
     109        ],
     110    };
     111
     112    runGetNumberOfFailingTestsTest(jsonData, function(failureCount, tooManyFailures) {
     113        equal(failureCount, -1);
     114        equal(tooManyFailures, false);
     115    });
    77116});
    78117
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js

    r90747 r90824  
    3131    start: function(buildName, callback, errorCallback) {
    3232        var cacheKey = 'LayoutTestResultsLoader.' + this._builder.name + '.' + buildName;
    33         const currentCachedDataVersion = 4;
     33        const currentCachedDataVersion = 5;
    3434        if (PersistentCache.contains(cacheKey)) {
    3535            var cachedData = PersistentCache.get(cacheKey);
  • trunk/Tools/ChangeLog

    r90823 r90824  
     12011-07-12  Adam Roben  <aroben@apple.com>
     2
     3        Teach TestFailures to recognize when run-webkit-tests gets killed by buildbot
     4
     5        Fixes <http://webkit.org/b/64358> TestFailures page thinks all tests passed in
     6        http://build.webkit.org/builders/Windows%207%20Release%20(Tests)/builds/14672
     7
     8        Reviewed by Daniel Bates.
     9
     10        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder.js:
     11        (Builder.prototype.getNumberOfFailingTests): If run-webkit-tests exited with a non-zero
     12        exit status but we didn't find any failure counts, assume that there was some error that
     13        caused run-webkit-tests to die early (like being killed by buildbot due to a timeout).
     14
     15        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder_unittests.js:
     16        Added a new test that shows that we get a failingTestCount of -1 when run-webkit-tests dies
     17        early.
     18        (runGetNumberOfFailingTestsTest): Moved most code here from the only pre-existing test in this
     19        file.
     20
     21        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js:
     22        (LayoutTestResultsLoader.prototype.start): Bump the cache number so old cached data that was
     23        tainted by the bug fixed in this patch will be evicted.
     24
    1252011-07-12  Adam Barth  <abarth@webkit.org>
    226
Note: See TracChangeset for help on using the changeset viewer.