Changeset 85346 in webkit


Ignore:
Timestamp:
Apr 29, 2011 12:14:42 PM (13 years ago)
Author:
ojan@chromium.org
Message:

2011-04-29 Ojan Vafai <ojan@chromium.org>

Reviewed by Eric Seidel.

handle flaky failures
https://bugs.webkit.org/show_bug.cgi?id=59820

Handle that actual can be a space-separated list of results
when we do retries. Also, show expected flaky tests that pass
in the unexpected passes table.

  • fast/harness/resources/results-test.js:
  • fast/harness/results.html:
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r85342 r85346  
     12011-04-29  Ojan Vafai  <ojan@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        handle flaky failures
     6        https://bugs.webkit.org/show_bug.cgi?id=59820
     7
     8        Handle that actual can be a space-separated list of results
     9        when we do retries. Also, show expected flaky tests that pass
     10        in the unexpected passes table.
     11
     12        * fast/harness/resources/results-test.js:
     13        * fast/harness/results.html:
     14
    1152011-04-29  Mark Pilgrim  <pilgrim@chromium.org>
    216
  • trunk/LayoutTests/fast/harness/resources/results-test.js

    r85260 r85346  
    221221    runDefaultSingleRowTest('bar-flaky-fail-unexpected.html', 'PASS TEXT', 'IMAGE', false, '', 'expected actual diff ');
    222222    runDefaultSingleRowTest('bar-crash.html', 'TEXT', 'CRASH', false, 'stack ', '');
    223     runDefaultSingleRowTest('bar-audio.html', 'TEXT', 'AUDIO', false, 'expected actual ', '');
     223    runDefaultSingleRowTest('bar-audio.html', 'TEXT', 'AUDIO', false, 'expected audio actual audio ', '');
    224224    runDefaultSingleRowTest('bar-timeout.html', 'TEXT', 'TIMEOUT', false, 'expected actual diff ', '');
    225225    runDefaultSingleRowTest('bar-image.html', 'TEXT', 'IMAGE', false, '', 'expected actual diff ');
     
    238238    results = mockResults();
    239239    var subtree = results.tests['foo'] = {}
    240     subtree['bar-flaky-pass.html'] = mockExpectation('PASS FAIL', 'PASS');
    241     runTest(results, function() {
    242         // FIXME: should a PASS FAIL test that passes go in the unexpected passes table?
    243         assertTrue(document.body.textContent.indexOf('foo/bar-flaky-pass.html') == -1);
     240    subtree['bar-flaky-pass.html'] = mockExpectation('PASS TEXT', 'PASS');
     241    runTest(results, function() {
     242        assertTrue(!document.getElementById('results-table'));
     243        assertTrue(document.getElementById('passes-table'));
     244        assertTrue(document.body.textContent.indexOf('foo/bar-flaky-pass.html') != -1);
     245    });
     246
     247    results = mockResults();
     248    var subtree = results.tests['foo'] = {}
     249    subtree['bar-flaky-fail.html'] = mockExpectation('PASS TEXT', 'IMAGE PASS');
     250    runTest(results, function() {
     251        assertTrue(document.getElementById('results-table'));
     252        assertTrue(document.body.textContent.indexOf('bar-flaky-fail.html') != -1);
    244253    });
    245254
     
    357366    shouldUseTracLinks = oldShouldUseTracLinks;
    358367
     368    runDefaultSingleRowTest('bar-flaky-crash.html', 'TEXT', 'TIMEOUT CRASH AUDIO', false, 'expected actual diff stack expected audio actual audio ', '');
     369
    359370    document.body.innerHTML = '<pre>' + g_log.join('\n') + '</pre>';
    360371}
  • trunk/LayoutTests/fast/harness/results.html

    r85254 r85346  
    320320        return;
    321321    }
    322 
     322   
    323323    var expected = testObject.expected || 'PASS';
    324     testObject.isExpected = actual == 'SKIP';
    325     if (!testObject.isExpected && globalState().results.uses_expectations_file) {
     324    testObject.isExpected = true;
     325    if (actual != 'SKIP' && globalState().results.uses_expectations_file) {
    326326        var expectedArray = expected.split(' ');
    327         if (expectedArray.indexOf(actual) != -1)
    328             testObject.isExpected = true;
    329         else if (expectedArray.indexOf('FAIL') != -1)
    330             testObject.isExpected = actual == 'IMAGE' || actual == 'TEXT' || actual == 'IMAGE+TEXT';
    331     }
    332 
    333     if (actual == 'PASS' && expected != 'PASS' && !testObject.isExpected)
     327        var actualArray = actual.split(' ');
     328        for (var i = 0; i < actualArray.length; i++) {
     329            var actualValue = actualArray[i];
     330            if (expectedArray.indexOf(actualValue) == -1 &&
     331                (expectedArray.indexOf('FAIL') == -1 ||
     332                 (actualValue != 'IMAGE' && actualValue != 'TEXT' && actualValue != 'IMAGE+TEXT')))
     333                testObject.isExpected = false;
     334        }
     335    }
     336
     337    if (actual == 'PASS' && expected != 'PASS')
    334338        globalState().unexpectedPassTests.push(test);           
    335339}
     
    337341function tableRow(testObject)
    338342{   
     343    var row = '<tbody'
     344    if (globalState().results.uses_expectations_file)
     345        row += ' class="' + (testObject.isExpected ? 'expected' : '') + '"';
     346    row += '><tr>';
     347
     348    row += '<td>' + testLink(testObject.name) + '</td>';
     349
     350    var test_prefix = stripExtension(testObject.name);
     351    row += '<td>';
     352   
    339353    var actual = testObject.actual;
    340     if (actual == 'PASS')
    341         return '';
    342 
    343     var row = '<td>' + testLink(testObject.name) + '</td>';
    344     var test_prefix = stripExtension(testObject.name);
    345 
    346     row += '<td>';
    347 
    348     if (actual == 'CRASH')
    349         row += resultLink(test_prefix, '-stack.txt', 'stack');
    350     else if (actual == 'AUDIO') {
    351         row += resultLink(test_prefix, '-expected.wav', 'expected');
    352         row += resultLink(test_prefix, '-actual.wav', 'actual');
    353     } else if (actual.indexOf('TEXT') != -1 || actual == 'TIMEOUT') {
     354    if (actual.indexOf('TEXT') != -1 || actual.indexOf('TIMEOUT') != -1) {
    354355        // FIXME: only include timeout actual/expected results here if we actually spit out results for timeout tests.
    355356        globalState().hasTextFailures = true;
     
    365366    }
    366367
     368    if (actual.indexOf('CRASH') != -1)
     369        row += resultLink(test_prefix, '-stack.txt', 'stack');
     370   
     371    if (actual.indexOf('AUDIO') != -1) {
     372        row += resultLink(test_prefix, '-expected.wav', 'expected audio');
     373        row += resultLink(test_prefix, '-actual.wav', 'actual audio');
     374    }
     375
    367376    row += '</td><td>';
    368377
     
    389398      row += '<td>' + testObject.expected + '</td>';
    390399
    391     return '<tbody class="' + (testObject.isExpected ? 'expected' : '') + '"><tr>' + row + '</tr></tbody>';
     400    row += '</tr></tbody>';
     401    return row;
    392402}
    393403
Note: See TracChangeset for help on using the changeset viewer.