Changeset 116552 in webkit


Ignore:
Timestamp:
May 9, 2012 12:59:44 PM (12 years ago)
Author:
dpranke@chromium.org
Message:

nrwt: --skip-failing-tests should also skip flaky tests
https://bugs.webkit.org/show_bug.cgi?id=85941

Reviewed by Ojan Vafai.

This changes --skip-failing-tests so that we skip tests that
are believed to pass sometimes as well as tests that are
believed to always fail.

In addition, in testing this I discovered that we had lousy
test coverage of the details of retrying test failures and
--clobber-old-results, so I wrote some more tests.

  • Scripts/webkitpy/layout_tests/controllers/manager.py:

(Manager.prepare_lists_and_print_output):

  • Scripts/webkitpy/layout_tests/port/test.py:

(unit_test_list):
(TestPort.init):
(TestDriver.run_test):

  • Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:

(MainTest.test_skip_failing_tests):
(MainTest.test_retrying_and_flaky_tests):

Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r116547 r116552  
     12012-05-09  Dirk Pranke  <dpranke@chromium.org>
     2
     3        nrwt: --skip-failing-tests should also skip flaky tests
     4        https://bugs.webkit.org/show_bug.cgi?id=85941
     5
     6        Reviewed by Ojan Vafai.
     7
     8        This changes --skip-failing-tests so that we skip tests that
     9        are believed to pass sometimes as well as tests that are
     10        believed to always fail.
     11
     12        In addition, in testing this I discovered that we had lousy
     13        test coverage of the details of retrying test failures and
     14        --clobber-old-results, so I wrote some more tests.
     15
     16        * Scripts/webkitpy/layout_tests/controllers/manager.py:
     17        (Manager.prepare_lists_and_print_output):
     18        * Scripts/webkitpy/layout_tests/port/test.py:
     19        (unit_test_list):
     20        (TestPort.__init__):
     21        (TestDriver.run_test):
     22        * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
     23        (MainTest.test_skip_failing_tests):
     24        (MainTest.test_retrying_and_flaky_tests):
     25
    1262012-05-09  Christophe Dumez  <christophe.dumez@intel.com>
    227
  • trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py

    r116021 r116552  
    479479
    480480        if num_all_test_files > 1 and not self._options.force:
    481             skipped = skipped.union(self._expectations.get_tests_with_result_type(test_expectations.SKIP))
     481            skipped.update(self._expectations.get_tests_with_result_type(test_expectations.SKIP))
    482482            if self._options.skip_failing_tests:
    483                 failing = self._expectations.get_tests_with_result_type(test_expectations.FAIL)
    484                 self._test_files -= failing
     483                skipped.update(self._expectations.get_tests_with_result_type(test_expectations.FAIL))
     484                skipped.update(self._expectations.get_tests_with_result_type(test_expectations.FLAKY))
    485485
    486486        self._test_files -= skipped
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py

    r115977 r116552  
    137137    tests.add('failures/expected/text.html', actual_text='text_fail-png')
    138138    tests.add('failures/expected/skip_text.html', actual_text='text diff')
     139    tests.add('failures/flaky/text.html')
    139140    tests.add('failures/unexpected/missing_text.html', expected_text=None)
    140141    tests.add('failures/unexpected/missing_image.html', expected_image=None)
     
    335336        Port.__init__(self, host, port_name, **kwargs)
    336337        self._tests = unit_test_list()
     338        self._flakes = set()
    337339        self._expectations_path = LAYOUT_TEST_DIR + '/platform/test/test_expectations.txt'
    338340        self._results_directory = None
     
    514516        audio = None
    515517        actual_text = test.actual_text
     518
     519        if 'flaky' in test_name and not test_name in self._port._flakes:
     520            self._port._flakes.add(test_name)
     521            actual_text = 'flaky text failure'
     522
    516523        if actual_text and test_args and test_name == 'passes/args.html':
    517524            actual_text = actual_text + ' ' + ' '.join(test_args)
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py

    r115894 r116552  
    461461
    462462    def test_skip_failing_tests(self):
    463         batches = get_tests_run(['--skip-failing-tests'])
     463        # This tests that we skip both known failing and known flaky tests. Because there are
     464        # no known flaky tests in the default test_expectations, we add additional expectations.
     465        host = MockHost()
     466        host.filesystem.write_text_file('/tmp/overrides.txt', 'BUGX : passes/image.html = IMAGE PASS\n')
     467
     468        batches = get_tests_run(['--skip-failing-tests', '--additional-expectations', '/tmp/overrides.txt'], host=host)
    464469        has_passes_text = False
    465470        for batch in batches:
    466471            self.assertFalse('failures/expected/text.html' in batch)
     472            self.assertFalse('passes/image.html' in batch)
    467473            has_passes_text = has_passes_text or ('passes/text.html' in batch)
    468474        self.assertTrue(has_passes_text)
     
    719725        self.assertEqual(user.opened_urls, [path.abspath_to_uri('/tmp/cwd/foo/results.html')])
    720726
    721     def test_retries_directory(self):
    722         host = MockHost()
    723         res, out, err, user = logging_run(tests_included=True, host=host)
     727    def test_retrying_and_flaky_tests(self):
     728        host = MockHost()
     729        res, out, err, _ = logging_run(['failures/flaky'], tests_included=True, host=host)
     730        self.assertEquals(res, 0)
     731        self.assertTrue('Retrying' in err.getvalue())
     732        self.assertTrue('Unexpected flakiness' in out.getvalue())
     733        self.assertTrue(host.filesystem.exists('/tmp/layout-test-results/failures/flaky/text-actual.txt'))
    724734        self.assertTrue(host.filesystem.exists('/tmp/layout-test-results/retries/tests_run0.txt'))
     735        self.assertFalse(host.filesystem.exists('/tmp/layout-test-results/retries/failures/flaky/text-actual.txt'))
     736
     737        # Now we test that --clobber-old-results does remove the old entries and the old retries,
     738        # and that we don't retry again.
     739        res, out, err, _ = logging_run(['--no-retry-failures', '--clobber-old-results', 'failures/flaky'], tests_included=True, host=host)
     740        self.assertEquals(res, 1)
     741        self.assertTrue('Clobbering old results' in err.getvalue())
     742        self.assertTrue('flaky/text.html' in err.getvalue())
     743        self.assertTrue('Unexpected text diff' in out.getvalue())
     744        self.assertFalse('Unexpected flakiness' in out.getvalue())
     745        self.assertTrue(host.filesystem.exists('/tmp/layout-test-results/failures/flaky/text-actual.txt'))
     746        self.assertFalse(host.filesystem.exists('retries'))
     747
    725748
    726749    # These next tests test that we run the tests in ascending alphabetical
Note: See TracChangeset for help on using the changeset viewer.