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

Changeset 93222 in webkit


Ignore:
Timestamp:
Aug 17, 2011, 11:13:12 AM (15 years ago)
Author:
Adam Roben
Message:

Teach TestFailures to ignore unbelievably short test runs

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

Reviewed by Dan Bates.

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

(Builder.prototype.getNumberOfFailingTests): If it looks like all tests passed, but
run-webkit-tests took less than 10 seconds to run, assume that some weird error occurred
that caused it not to run any tests at all (as happened for a while due to
<http://webkit.org/b/64988>). Bumped the cache version to evict old, buggy cached data.

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

Test for the above.

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

(LayoutTestResultsLoader.prototype.start): Bumped the cache version to evict old, buggy cached data.

Location:
trunk/Tools
Files:
4 edited

Legend:

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

    r93111 r93222  
    101101    getNumberOfFailingTests: function(buildNumber, callback) {
    102102        var cacheKey = this.name + '_getNumberOfFailingTests_' + buildNumber;
    103         const currentCachedDataVersion = 2;
     103        const currentCachedDataVersion = 3;
    104104        if (PersistentCache.contains(cacheKey)) {
    105105            var cachedData = PersistentCache.get(cacheKey);
     
    129129
    130130            if (!('results' in layoutTestStep) || layoutTestStep.results[0] === 0) {
     131                if (!('times' in layoutTestStep) || layoutTestStep.times.length < 2 || layoutTestStep.times[1] - layoutTestStep.times[0] < self._minimumSuccessfulLayoutTestStepRunTime) {
     132                    // Either something caused the start/stop times not to be recorded, or
     133                    // run-webkit-tests ran so quickly that we can't believe there wasn't an error
     134                    // (e.g., a bug in the script that made it not find any tests to run).
     135                    PersistentCache.set(cacheKey, result);
     136                    callback(result.failureCount, result.tooManyFailures);
     137                    return;
     138                }
     139
    131140                // All tests passed.
    132141                result.failureCount = 0;
     
    225234        });
    226235    },
     236
     237    // Any successful runs of run-webkit-tests that took less than this number of seconds are
     238    // assumed to be errors.
     239    _minimumSuccessfulLayoutTestStepRunTime: 20,
    227240};
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder_unittests.js

    r93111 r93222  
    7575                    ],
    7676                ],
     77                times: [
     78                    1310599204.1231229,
     79                    1310600152.973659,
     80                ]
    7781            },
    7882        ],
     
    205209});
    206210
     211test("getNumberOfFailingTests treats successful but unbelievably short test runs as errors", 4, function() {
     212    const jsonData = {
     213        steps: [
     214            {
     215                isFinished: true,
     216                isStarted: true,
     217                name: "layout-test",
     218                step_number: 7,
     219                text: [
     220                    "layout-test"
     221                ],
     222                times: [
     223                    1311288797.7207019,
     224                    1311288802.7791941
     225                ]
     226            },
     227        ],
     228    };
     229
     230    runGetNumberOfFailingTestsTest(jsonData, function(failureCount, tooManyFailures) {
     231        equal(failureCount, -1);
     232        equal(tooManyFailures, false);
     233    });
     234});
     235
     236test("getNumberOfFailingTests doesn't care if a failing run is unbelievably short", 4, function() {
     237    const jsonData = {
     238        steps: [
     239            {
     240                isFinished: true,
     241                isStarted: true,
     242                name: "layout-test",
     243                results: [
     244                  2,
     245                  [
     246                      "2011-07-13 04:38:46,315 11247 manager.py:780 WARNING Exiting early after 20 crashes and 0 timeouts. 2251 tests run.",
     247                      "20 failed"
     248                  ]
     249                ],
     250                step_number: 4,
     251                text: [
     252                    "2011-07-13 04:38:46,315 11247 manager.py:780 WARNING Exiting early after 20 crashes and 0 timeouts. 2251 tests run.",
     253                    "20 failed"
     254                ],
     255                times: [
     256                    1310557115.793082,
     257                    1310557119.832104
     258                ]
     259            },
     260        ],
     261    };
     262
     263    runGetNumberOfFailingTestsTest(jsonData, function(failureCount, tooManyFailures) {
     264        equal(failureCount, 20);
     265        equal(tooManyFailures, true);
     266    });
     267});
     268
    207269})();
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js

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

    r93190 r93222  
     12011-08-17  Adam Roben  <aroben@apple.com>
     2
     3        Teach TestFailures to ignore unbelievably short test runs
     4
     5        Fixes <http://webkit.org/b/66385> TestFailures page thinks all tests passed in
     6        http://build.webkit.org/builders/Windows%207%20Release%20(Tests)/builds/14956
     7
     8        Reviewed by Dan Bates.
     9
     10        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder.js:
     11        (Builder.prototype.getNumberOfFailingTests): If it looks like all tests passed, but
     12        run-webkit-tests took less than 10 seconds to run, assume that some weird error occurred
     13        that caused it not to run any tests at all (as happened for a while due to
     14        <http://webkit.org/b/64988>). Bumped the cache version to evict old, buggy cached data.
     15
     16        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder_unittests.js:
     17        Test for the above.
     18
     19        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js:
     20        (LayoutTestResultsLoader.prototype.start): Bumped the cache version to evict old, buggy cached data.
     21
    1222011-08-16  Adam Barth  <abarth@webkit.org>
    223
Note: See TracChangeset for help on using the changeset viewer.