Changeset 212182 in webkit


Ignore:
Timestamp:
Feb 10, 2017 10:01:20 PM (7 years ago)
Author:
clopez@igalia.com
Message:

REGRESSION(r182916) run-perf-tests never timeouts
https://bugs.webkit.org/show_bug.cgi?id=167626

Reviewed by Ryosuke Niwa.

The --time-out-ms value (defaults to 600 seconds) of run-perf-tests
was beeing ignored because the driver was created with no_timeout=True
unconditionally.
This adds a new parameter --no-timeout (disabled by default), that
allows to use the driver with the expected timeout values.
It also passes --no-timeout to DRT/WTR to ensure that timeouts
are always controlled by the Python Driver.

  • Scripts/webkitpy/performance_tests/perftest.py:

(PerfTest._create_driver): Only disable timeout if --no-timeout is passed.
(PerfTest.run): Disabling timeout should be done when the Driver is created.

  • Scripts/webkitpy/performance_tests/perftestsrunner.py:

(PerfTestsRunner.init): Ensure --no-timeout is passed to DRT/WTR
(PerfTestsRunner._parse_args): Add a --no-timeout parameter.
(_run_tests_set): Pass the no-timeout parameter.

  • Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:

(MainTest.test_drt_notimeout): Test --no-timeout is passed to DRT/WTR
(MainTest.test_default_args): Test default values for additional_drt_flag and no_timeout.
(MainTest.test_parse_args): Test that the argument no-timeout.

Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r212173 r212182  
     12017-02-10  Carlos Alberto Lopez Perez  <clopez@igalia.com>
     2
     3        REGRESSION(r182916) run-perf-tests never timeouts
     4        https://bugs.webkit.org/show_bug.cgi?id=167626
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        The --time-out-ms value (defaults to 600 seconds) of run-perf-tests
     9        was beeing ignored because the driver was created with no_timeout=True
     10        unconditionally.
     11        This adds a new parameter --no-timeout (disabled by default), that
     12        allows to use the driver with the expected timeout values.
     13        It also passes --no-timeout to DRT/WTR to ensure that timeouts
     14        are always controlled by the Python Driver.
     15
     16        * Scripts/webkitpy/performance_tests/perftest.py:
     17        (PerfTest._create_driver): Only disable timeout if --no-timeout is passed.
     18        (PerfTest.run): Disabling timeout should be done when the Driver is created.
     19        * Scripts/webkitpy/performance_tests/perftestsrunner.py:
     20        (PerfTestsRunner.__init__): Ensure --no-timeout is passed to DRT/WTR
     21        (PerfTestsRunner._parse_args): Add a --no-timeout parameter.
     22        (_run_tests_set): Pass the no-timeout parameter.
     23        * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
     24        (MainTest.test_drt_notimeout): Test --no-timeout is passed to DRT/WTR
     25        (MainTest.test_default_args): Test default values for additional_drt_flag and no_timeout.
     26        (MainTest.test_parse_args): Test that the argument no-timeout.
     27
    1282017-02-10  Daniel Bates  <dabates@apple.com>
    229
  • trunk/Tools/Scripts/webkitpy/performance_tests/perftest.py

    r190535 r212182  
    123123        return True
    124124
    125     def _create_driver(self):
    126         return self._port.create_driver(worker_number=0, no_timeout=True)
    127 
    128     def run(self, time_out_ms):
     125    def _create_driver(self, no_timeout):
     126        return self._port.create_driver(worker_number=0, no_timeout=no_timeout)
     127
     128    def run(self, time_out_ms, no_timeout=False):
    129129        for _ in xrange(self._test_runner_count):
    130             driver = self._create_driver()
     130            driver = self._create_driver(no_timeout)
    131131            try:
    132132                if not self._run_with_driver(driver, time_out_ms):
  • trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py

    r210523 r212182  
    6767            self._port = self._host.port_factory.get(self._options.platform, self._options)
    6868
     69        # Timeouts are controlled by the Python Driver, so DRT/WTR runs with no-timeout.
     70        self._options.additional_drt_flag.append('--no-timeout')
     71
    6972        # The GTK+ and EFL ports only supports WebKit2, so they always use WKTR.
    7073        if self._port.name().startswith("gtk") or self._port.name().startswith("efl"):
     
    101104            optparse.make_option("--time-out-ms", default=600 * 1000,
    102105                help="Set the timeout for each test"),
     106            optparse.make_option("--no-timeout", action="store_true", default=False,
     107                help="Disable test timeouts"),
    103108            optparse.make_option("--no-results", action="store_false", dest="generate_results", default=True,
    104109                help="Do no generate results JSON and results page."),
     
    376381            _log.info('Running %s (%d of %d)' % (test.test_name(), i + 1, len(tests)))
    377382            start_time = time.time()
    378             metrics = test.run(self._options.time_out_ms)
     383            metrics = test.run(self._options.time_out_ms, self._options.no_timeout)
     384
    379385            if metrics:
    380386                self._results += metrics
  • trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py

    r174136 r212182  
    5656        runner._host.filesystem.files[runner._host.filesystem.join(dirname, filename)] = content
    5757
     58    def test_drt_notimeout(self):
     59        runner, port = self.create_runner()
     60        self.assertEqual(runner._options.additional_drt_flag, ['--no-timeout'])
     61
    5862    def test_collect_tests(self):
    5963        runner, port = self.create_runner()
     
    117121        self.assertTrue(options.build)
    118122        self.assertEqual(options.time_out_ms, 600 * 1000)
     123        self.assertEqual(options.additional_drt_flag, [])
    119124        self.assertTrue(options.generate_results)
    120125        self.assertTrue(options.show_results)
     
    122127        self.assertEqual(options.repeat, 1)
    123128        self.assertEqual(options.test_runner_count, -1)
     129        self.assertEqual(options.no_timeout, False)
    124130
    125131    def test_parse_args(self):
     
    140146                '--repeat=5',
    141147                '--test-runner-count=5',
    142                 '--debug'])
     148                '--debug',
     149                '--no-timeout'])
    143150        self.assertTrue(options.build)
    144151        self.assertEqual(options.build_directory, 'folder42')
     
    156163        self.assertEqual(options.repeat, 5)
    157164        self.assertEqual(options.test_runner_count, 5)
     165        self.assertEqual(options.no_timeout, True)
    158166
    159167    def test_upload_json(self):
Note: See TracChangeset for help on using the changeset viewer.