<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[177028] trunk/Tools</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/177028">177028</a></dd>
<dt>Author</dt> <dd>ossy@webkit.org</dd>
<dt>Date</dt> <dd>2014-12-09 11:32:54 -0800 (Tue, 09 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Blink Merge: Remove 'http_lock' code from webkitpy
https://bugs.webkit.org/show_bug.cgi?id=136722
Reviewed by Alexey Proskuryakov.
Based on Blink commit by Dirk Pranke <dpranke@chromium.org>
https://chromium.googlesource.com/chromium/blink/+/196f8146a948275c2f1594b13e30ab19a6e6fd66
* Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
(LayoutTestRunner.__init__):
(LayoutTestRunner.run_tests):
(LayoutTestRunner.start_servers): Renamed from start_servers_with_lock.
(LayoutTestRunner.stop_servers): Renamed from stop_servers_with_lock.
* Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py:
(FakePrinter.flush):
(LayoutTestRunnerTests._runner):
(LayoutTestRunnerTests._run_tests):
(LayoutTestRunnerTests.test_servers_started):
(LockCheckingRunner): Deleted.
(LockCheckingRunner.__init__): Deleted.
(LockCheckingRunner.handle_finished_list): Deleted.
(LayoutTestRunnerTests.test_http_locking): Deleted.
* Scripts/webkitpy/port/base.py:
(Port.__init__):
(Port.to.http_server_supports_ipv6):
(Port.to.stop_websocket_server):
(Port.to.acquire_http_lock): Deleted.
(Port.to.release_http_lock): Deleted.
* Scripts/webkitpy/port/http_lock.py: Removed.
* Scripts/webkitpy/port/http_lock_unittest.py: Removed.
* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort.show_results_html_file):
(IOSSimulatorPort.acquire_http_lock): Deleted.
(IOSSimulatorPort): Deleted.
(IOSSimulatorPort.release_http_lock): Deleted.
* Scripts/webkitpy/port/mac.py:
(MacPort.show_results_html_file):
(MacPort): Deleted.
(MacPort.acquire_http_lock): Deleted.
(MacPort.release_http_lock): Deleted.
* Scripts/webkitpy/port/mock_drt.py:
(MockDRTPort.start_websocket_server):
(MockDRTPort.stop_websocket_server):
(MockDRTPort.acquire_http_lock): Deleted.
(MockDRTPort.release_http_lock): Deleted.
* Scripts/webkitpy/port/mock_drt_unittest.py:
(MockDRTPortTest.test_uses_apache):
(MockDRTPortTest.integration_test_http_lock): Deleted.
* Scripts/webkitpy/port/port_testcase.py:
(PortTestCase.assert_servers_are_up):
(PortTestCase.integration_test_http_lock): Deleted.
* Scripts/webkitpy/port/test.py:
(TestPort.start_websocket_server):
(TestPort.stop_websocket_server):
(TestPort.acquire_http_lock): Deleted.
(TestPort.release_http_lock): Deleted.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptswebkitpylayout_testscontrollerslayout_test_runnerpy">trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py</a></li>
<li><a href="#trunkToolsScriptswebkitpylayout_testscontrollerslayout_test_runner_unittestpy">trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportbasepy">trunk/Tools/Scripts/webkitpy/port/base.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportiospy">trunk/Tools/Scripts/webkitpy/port/ios.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportmacpy">trunk/Tools/Scripts/webkitpy/port/mac.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportmock_drtpy">trunk/Tools/Scripts/webkitpy/port/mock_drt.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportmock_drt_unittestpy">trunk/Tools/Scripts/webkitpy/port/mock_drt_unittest.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportport_testcasepy">trunk/Tools/Scripts/webkitpy/port/port_testcase.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyporttestpy">trunk/Tools/Scripts/webkitpy/port/test.py</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkToolsScriptswebkitpyporthttp_lockpy">trunk/Tools/Scripts/webkitpy/port/http_lock.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyporthttp_lock_unittestpy">trunk/Tools/Scripts/webkitpy/port/http_lock_unittest.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (177027 => 177028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-12-09 19:08:43 UTC (rev 177027)
+++ trunk/Tools/ChangeLog        2014-12-09 19:32:54 UTC (rev 177028)
</span><span class="lines">@@ -1,3 +1,62 @@
</span><ins>+2014-12-09 Csaba Osztrogonác <ossy@webkit.org>
+
+ Blink Merge: Remove 'http_lock' code from webkitpy
+ https://bugs.webkit.org/show_bug.cgi?id=136722
+
+ Reviewed by Alexey Proskuryakov.
+
+ Based on Blink commit by Dirk Pranke <dpranke@chromium.org>
+ https://chromium.googlesource.com/chromium/blink/+/196f8146a948275c2f1594b13e30ab19a6e6fd66
+
+ * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
+ (LayoutTestRunner.__init__):
+ (LayoutTestRunner.run_tests):
+ (LayoutTestRunner.start_servers): Renamed from start_servers_with_lock.
+ (LayoutTestRunner.stop_servers): Renamed from stop_servers_with_lock.
+ * Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py:
+ (FakePrinter.flush):
+ (LayoutTestRunnerTests._runner):
+ (LayoutTestRunnerTests._run_tests):
+ (LayoutTestRunnerTests.test_servers_started):
+ (LockCheckingRunner): Deleted.
+ (LockCheckingRunner.__init__): Deleted.
+ (LockCheckingRunner.handle_finished_list): Deleted.
+ (LayoutTestRunnerTests.test_http_locking): Deleted.
+ * Scripts/webkitpy/port/base.py:
+ (Port.__init__):
+ (Port.to.http_server_supports_ipv6):
+ (Port.to.stop_websocket_server):
+ (Port.to.acquire_http_lock): Deleted.
+ (Port.to.release_http_lock): Deleted.
+ * Scripts/webkitpy/port/http_lock.py: Removed.
+ * Scripts/webkitpy/port/http_lock_unittest.py: Removed.
+ * Scripts/webkitpy/port/ios.py:
+ (IOSSimulatorPort.show_results_html_file):
+ (IOSSimulatorPort.acquire_http_lock): Deleted.
+ (IOSSimulatorPort): Deleted.
+ (IOSSimulatorPort.release_http_lock): Deleted.
+ * Scripts/webkitpy/port/mac.py:
+ (MacPort.show_results_html_file):
+ (MacPort): Deleted.
+ (MacPort.acquire_http_lock): Deleted.
+ (MacPort.release_http_lock): Deleted.
+ * Scripts/webkitpy/port/mock_drt.py:
+ (MockDRTPort.start_websocket_server):
+ (MockDRTPort.stop_websocket_server):
+ (MockDRTPort.acquire_http_lock): Deleted.
+ (MockDRTPort.release_http_lock): Deleted.
+ * Scripts/webkitpy/port/mock_drt_unittest.py:
+ (MockDRTPortTest.test_uses_apache):
+ (MockDRTPortTest.integration_test_http_lock): Deleted.
+ * Scripts/webkitpy/port/port_testcase.py:
+ (PortTestCase.assert_servers_are_up):
+ (PortTestCase.integration_test_http_lock): Deleted.
+ * Scripts/webkitpy/port/test.py:
+ (TestPort.start_websocket_server):
+ (TestPort.stop_websocket_server):
+ (TestPort.acquire_http_lock): Deleted.
+ (TestPort.release_http_lock): Deleted.
+
</ins><span class="cx"> 2014-12-09 Alberto Garcia <berto@igalia.com>
</span><span class="cx">
</span><span class="cx"> convertToUTF8String converts null string to empty string
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testscontrollerslayout_test_runnerpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py (177027 => 177028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py        2014-12-09 19:08:43 UTC (rev 177027)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py        2014-12-09 19:32:54 UTC (rev 177028)
</span><span class="lines">@@ -75,9 +75,7 @@
</span><span class="cx"> self._needs_http = None
</span><span class="cx"> self._needs_websockets = None
</span><span class="cx"> self._retrying = False
</span><del>-
</del><span class="cx"> self._current_run_results = None
</span><del>- self._has_http_lock = False
</del><span class="cx">
</span><span class="cx"> def run_tests(self, expectations, test_inputs, tests_to_skip, num_workers, needs_http, needs_websockets, retrying):
</span><span class="cx"> self._expectations = expectations
</span><span class="lines">@@ -89,7 +87,6 @@
</span><span class="cx"> # FIXME: rename all variables to test_run_results or some such ...
</span><span class="cx"> run_results = TestRunResults(self._expectations, len(test_inputs) + len(tests_to_skip))
</span><span class="cx"> self._current_run_results = run_results
</span><del>- self._has_http_lock = False
</del><span class="cx"> self._printer.num_tests = len(test_inputs)
</span><span class="cx"> self._printer.num_started = 0
</span><span class="cx">
</span><span class="lines">@@ -105,7 +102,7 @@
</span><span class="cx"> all_shards = self._sharder.shard_tests(test_inputs, int(self._options.child_processes), self._options.fully_parallel)
</span><span class="cx">
</span><span class="cx"> if self._needs_http and self._options.http:
</span><del>- self.start_servers_with_lock()
</del><ins>+ self.start_servers()
</ins><span class="cx">
</span><span class="cx"> num_workers = min(num_workers, len(all_shards))
</span><span class="cx"> self._printer.print_workers_and_shards(num_workers, len(all_shards))
</span><span class="lines">@@ -129,7 +126,7 @@
</span><span class="cx"> _log.debug('%s("%s") raised, exiting' % (e.__class__.__name__, str(e)))
</span><span class="cx"> raise
</span><span class="cx"> finally:
</span><del>- self.stop_servers_with_lock()
</del><ins>+ self.stop_servers()
</ins><span class="cx">
</span><span class="cx"> return run_results
</span><span class="cx">
</span><span class="lines">@@ -185,28 +182,21 @@
</span><span class="cx">
</span><span class="cx"> self._interrupt_if_at_failure_limits(run_results)
</span><span class="cx">
</span><del>- def start_servers_with_lock(self):
- self._printer.write_update('Acquiring http lock ...')
- self._port.acquire_http_lock()
</del><ins>+ def start_servers(self):
</ins><span class="cx"> if self._needs_http:
</span><span class="cx"> self._printer.write_update('Starting HTTP server ...')
</span><span class="cx"> self._port.start_http_server()
</span><span class="cx"> if self._needs_websockets:
</span><span class="cx"> self._printer.write_update('Starting WebSocket server ...')
</span><span class="cx"> self._port.start_websocket_server()
</span><del>- self._has_http_lock = True
</del><span class="cx">
</span><del>- def stop_servers_with_lock(self):
- if self._has_http_lock:
- if self._needs_http:
- self._printer.write_update('Stopping HTTP server ...')
- self._port.stop_http_server()
- if self._needs_websockets:
- self._printer.write_update('Stopping WebSocket server ...')
- self._port.stop_websocket_server()
- self._printer.write_update('Releasing server lock ...')
- self._port.release_http_lock()
- self._has_http_lock = False
</del><ins>+ def stop_servers(self):
+ if self._needs_http:
+ self._printer.write_update('Stopping HTTP server ...')
+ self._port.stop_http_server()
+ if self._needs_websockets:
+ self._printer.write_update('Stopping WebSocket server ...')
+ self._port.stop_websocket_server()
</ins><span class="cx">
</span><span class="cx"> def handle(self, name, source, *args):
</span><span class="cx"> method = getattr(self, '_handle_' + name)
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testscontrollerslayout_test_runner_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py (177027 => 177028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py        2014-12-09 19:08:43 UTC (rev 177027)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py        2014-12-09 19:32:54 UTC (rev 177028)
</span><span class="lines">@@ -70,27 +70,6 @@
</span><span class="cx"> pass
</span><span class="cx">
</span><span class="cx">
</span><del>-class LockCheckingRunner(LayoutTestRunner):
- def __init__(self, port, options, printer, tester, http_lock):
- super(LockCheckingRunner, self).__init__(options, port, printer, port.results_directory(), lambda test_name: False)
- self._finished_list_called = False
- self._tester = tester
- self._should_have_http_lock = http_lock
-
- def handle_finished_list(self, source, list_name, num_tests, elapsed_time):
- if not self._finished_list_called:
- self._tester.assertEqual(list_name, 'locked_tests')
- self._tester.assertTrue(self._remaining_locked_shards)
- self._tester.assertTrue(self._has_http_lock is self._should_have_http_lock)
-
- super(LockCheckingRunner, self).handle_finished_list(source, list_name, num_tests, elapsed_time)
-
- if not self._finished_list_called:
- self._tester.assertEqual(self._remaining_locked_shards, [])
- self._tester.assertFalse(self._has_http_lock)
- self._finished_list_called = True
-
-
</del><span class="cx"> class LayoutTestRunnerTests(unittest.TestCase):
</span><span class="cx"> def _runner(self, port=None):
</span><span class="cx"> # FIXME: we shouldn't have to use run_webkit_tests.py to get the options we need.
</span><span class="lines">@@ -99,7 +78,7 @@
</span><span class="cx">
</span><span class="cx"> host = MockHost()
</span><span class="cx"> port = port or host.port_factory.get(options.platform, options=options)
</span><del>- return LockCheckingRunner(port, options, FakePrinter(), self, True)
</del><ins>+ return LayoutTestRunner(options, port, FakePrinter(), port.results_directory(), lambda test_name: False)
</ins><span class="cx">
</span><span class="cx"> def _run_tests(self, runner, tests):
</span><span class="cx"> test_inputs = [TestInput(test, 6000) for test in tests]
</span><span class="lines">@@ -108,10 +87,6 @@
</span><span class="cx"> runner.run_tests(expectations, test_inputs, set(),
</span><span class="cx"> num_workers=1, needs_http=any('http' in test for test in tests), needs_websockets=any(['websocket' in test for test in tests]), retrying=False)
</span><span class="cx">
</span><del>- def test_http_locking(self):
- runner = self._runner()
- self._run_tests(runner, ['http/tests/passes/text.html', 'passes/text.html'])
-
</del><span class="cx"> def test_interrupt_if_at_failure_limits(self):
</span><span class="cx"> runner = self._runner()
</span><span class="cx"> runner._options.exit_after_n_failures = None
</span><span class="lines">@@ -189,30 +164,30 @@
</span><span class="cx"> runner = self._runner(port=port)
</span><span class="cx"> runner._needs_http = True
</span><span class="cx"> runner._needs_websockets = False
</span><del>- runner.start_servers_with_lock()
</del><ins>+ runner.start_servers()
</ins><span class="cx"> self.assertEqual(self.http_started, True)
</span><span class="cx"> self.assertEqual(self.websocket_started, False)
</span><del>- runner.stop_servers_with_lock()
</del><ins>+ runner.stop_servers()
</ins><span class="cx"> self.assertEqual(self.http_stopped, True)
</span><span class="cx"> self.assertEqual(self.websocket_stopped, False)
</span><span class="cx">
</span><span class="cx"> self.http_started = self.http_stopped = self.websocket_started = self.websocket_stopped = False
</span><span class="cx"> runner._needs_http = True
</span><span class="cx"> runner._needs_websockets = True
</span><del>- runner.start_servers_with_lock()
</del><ins>+ runner.start_servers()
</ins><span class="cx"> self.assertEqual(self.http_started, True)
</span><span class="cx"> self.assertEqual(self.websocket_started, True)
</span><del>- runner.stop_servers_with_lock()
</del><ins>+ runner.stop_servers()
</ins><span class="cx"> self.assertEqual(self.http_stopped, True)
</span><span class="cx"> self.assertEqual(self.websocket_stopped, True)
</span><span class="cx">
</span><span class="cx"> self.http_started = self.http_stopped = self.websocket_started = self.websocket_stopped = False
</span><span class="cx"> runner._needs_http = False
</span><span class="cx"> runner._needs_websockets = False
</span><del>- runner.start_servers_with_lock()
</del><ins>+ runner.start_servers()
</ins><span class="cx"> self.assertEqual(self.http_started, False)
</span><span class="cx"> self.assertEqual(self.websocket_started, False)
</span><del>- runner.stop_servers_with_lock()
</del><ins>+ runner.stop_servers()
</ins><span class="cx"> self.assertEqual(self.http_stopped, False)
</span><span class="cx"> self.assertEqual(self.websocket_stopped, False)
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportbasepy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/base.py (177027 => 177028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/base.py        2014-12-09 19:08:43 UTC (rev 177027)
+++ trunk/Tools/Scripts/webkitpy/port/base.py        2014-12-09 19:32:54 UTC (rev 177028)
</span><span class="lines">@@ -54,7 +54,6 @@
</span><span class="cx"> from webkitpy.layout_tests.models.test_configuration import TestConfiguration
</span><span class="cx"> from webkitpy.port import config as port_config
</span><span class="cx"> from webkitpy.port import driver
</span><del>-from webkitpy.port import http_lock
</del><span class="cx"> from webkitpy.port import image_diff
</span><span class="cx"> from webkitpy.port import server_process
</span><span class="cx"> from webkitpy.port.factory import PortFactory
</span><span class="lines">@@ -119,7 +118,6 @@
</span><span class="cx"> self._websocket_server = None
</span><span class="cx"> self._image_differ = None
</span><span class="cx"> self._server_process_constructor = server_process.ServerProcess # overridable for testing
</span><del>- self._http_lock = None # FIXME: Why does this live on the port object?
</del><span class="cx">
</span><span class="cx"> if not hasattr(options, 'configuration') or not options.configuration:
</span><span class="cx"> self.set_option_default('configuration', self.default_configuration())
</span><span class="lines">@@ -904,10 +902,6 @@
</span><span class="cx"> return False
</span><span class="cx"> return True
</span><span class="cx">
</span><del>- def acquire_http_lock(self):
- self._http_lock = http_lock.HttpLock(None, filesystem=self._filesystem, executive=self._executive)
- self._http_lock.wait_for_httpd_lock()
-
</del><span class="cx"> def stop_helper(self):
</span><span class="cx"> """Shut down the test helper if it is running. Do nothing if
</span><span class="cx"> it isn't, or it isn't available. If a port overrides start_helper()
</span><span class="lines">@@ -926,10 +920,6 @@
</span><span class="cx"> self._websocket_server.stop()
</span><span class="cx"> self._websocket_server = None
</span><span class="cx">
</span><del>- def release_http_lock(self):
- if self._http_lock:
- self._http_lock.cleanup_http_lock()
-
</del><span class="cx"> def exit_code_from_summarized_results(self, unexpected_results):
</span><span class="cx"> """Given summarized results, compute the exit code to be returned by new-run-webkit-tests.
</span><span class="cx"> Bots turn red when this function returns a non-zero value. By default, return the number of regressions
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyporthttp_lockpy"></a>
<div class="delfile"><h4>Deleted: trunk/Tools/Scripts/webkitpy/port/http_lock.py (177027 => 177028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/http_lock.py        2014-12-09 19:08:43 UTC (rev 177027)
+++ trunk/Tools/Scripts/webkitpy/port/http_lock.py        2014-12-09 19:32:54 UTC (rev 177028)
</span><span class="lines">@@ -1,149 +0,0 @@
</span><del>-# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
-# Copyright (C) 2010 Andras Becsi (abecsi@inf.u-szeged.hu), University of Szeged
-#
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# FIXME: rename this file, and add more text about how this is
-# different from the base file_lock class.
-
-"""This class helps to block NRWT threads when more NRWTs run
-perf, http and websocket tests in a same time."""
-
-import logging
-import os
-import sys
-import tempfile
-import time
-
-from webkitpy.common.system.executive import Executive
-from webkitpy.common.system.file_lock import FileLock
-from webkitpy.common.system.filesystem import FileSystem
-
-
-_log = logging.getLogger(__name__)
-
-
-class HttpLock(object):
- def __init__(self, lock_path, lock_file_prefix="WebKitHttpd.lock.", guard_lock="WebKit.lock", filesystem=None, executive=None, name='HTTP'):
- self._executive = executive or Executive()
- self._filesystem = filesystem or FileSystem()
- self._lock_path = lock_path
- if not self._lock_path:
- # FIXME: FileSystem should have an accessor for tempdir()
- self._lock_path = tempfile.gettempdir()
- self._lock_file_prefix = lock_file_prefix
- self._lock_file_path_prefix = self._filesystem.join(self._lock_path, self._lock_file_prefix)
- self._guard_lock_file = self._filesystem.join(self._lock_path, guard_lock)
- self._guard_lock = FileLock(self._guard_lock_file)
- self._process_lock_file_name = ""
- self._name = name
-
- def cleanup_http_lock(self):
- """Delete the lock file if exists."""
- if self._filesystem.exists(self._process_lock_file_name):
- _log.debug("Removing lock file: %s" % self._process_lock_file_name)
- self._filesystem.remove(self._process_lock_file_name)
-
- def _extract_lock_number(self, lock_file_name):
- """Return the lock number from lock file."""
- prefix_length = len(self._lock_file_path_prefix)
- return int(lock_file_name[prefix_length:])
-
- def _lock_file_list(self):
- """Return the list of lock files sequentially."""
- lock_list = self._filesystem.glob(self._lock_file_path_prefix + '*')
- lock_list.sort(key=self._extract_lock_number)
- return lock_list
-
- def _next_lock_number(self):
- """Return the next available lock number."""
- lock_list = self._lock_file_list()
- if not lock_list:
- return 0
- return self._extract_lock_number(lock_list[-1]) + 1
-
- def _current_lock_pid(self):
- """Return with the current lock pid. If the lock is not valid
- it deletes the lock file."""
- lock_list = self._lock_file_list()
- if not lock_list:
- _log.debug("No lock file list")
- return
- try:
- _log.debug("Retrieving current lock pid from %s" % lock_list[0])
- current_pid_string = self._filesystem.read_text_file(lock_list[0])
- _log.debug("Checking current lock on pid %s" % current_pid_string)
- if not current_pid_string:
- self._filesystem.remove(lock_list[0])
- return
-
- try:
- current_pid = int(current_pid_string)
- if not (current_pid and self._executive.check_running_pid(current_pid)):
- _log.debug("Removing stuck lock file: %s" % lock_list[0])
- self._filesystem.remove(lock_list[0])
- return
- except ValueError, e:
- _log.debug("ValueError: %s" % e)
- self._filesystem.remove(lock_list[0])
- return
- except IOError, e:
- _log.debug("IOError: %s" % e)
- return
- except OSError, e:
- _log.debug("OSError: %s" % e)
- return
- return int(current_pid)
-
- def _create_lock_file(self):
- """The lock files are used to schedule the running test sessions in first
- come first served order. The guard lock ensures that the lock numbers are
- sequential."""
- if not self._filesystem.exists(self._lock_path):
- _log.debug("Lock directory does not exist: %s" % self._lock_path)
- return False
-
- if not self._guard_lock.acquire_lock():
- _log.debug("Guard lock timed out!")
- return False
-
- self._process_lock_file_name = (self._lock_file_path_prefix + str(self._next_lock_number()))
- _log.debug("Creating lock file: %s" % self._process_lock_file_name)
- # FIXME: Executive.py should have an accessor for getpid()
- self._filesystem.write_text_file(self._process_lock_file_name, str(os.getpid()))
- self._guard_lock.release_lock()
- return True
-
- def wait_for_httpd_lock(self):
- """Create a lock file and wait until it's turn comes. If something goes wrong
- it wont do any locking."""
- if not self._create_lock_file():
- _log.debug("Warning, %s locking failed!" % self._name)
- return
-
- # FIXME: This can hang forever!
- while self._current_lock_pid() != os.getpid():
- time.sleep(1)
-
- _log.debug("%s lock acquired" % self._name)
</del></span></pre></div>
<a id="trunkToolsScriptswebkitpyporthttp_lock_unittestpy"></a>
<div class="delfile"><h4>Deleted: trunk/Tools/Scripts/webkitpy/port/http_lock_unittest.py (177027 => 177028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/http_lock_unittest.py        2014-12-09 19:08:43 UTC (rev 177027)
+++ trunk/Tools/Scripts/webkitpy/port/http_lock_unittest.py        2014-12-09 19:32:54 UTC (rev 177028)
</span><span class="lines">@@ -1,120 +0,0 @@
</span><del>-# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
-#
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-from http_lock import HttpLock
-import os # Used for os.getpid()
-import unittest
-
-from webkitpy.common.system.filesystem_mock import MockFileSystem
-from webkitpy.common.system.executive_mock import MockExecutive
-
-
-# FIXME: These tests all touch the real disk, but could be written to a MockFileSystem instead.
-class HttpLockTestWithRealFileSystem(unittest.TestCase):
- # FIXME: Unit tests do not use an __init__ method, but rather setUp and tearDown methods.
- def __init__(self, testFunc):
- self.http_lock = HttpLock(None, "WebKitTestHttpd.lock.", "WebKitTest.lock")
- self.filesystem = self.http_lock._filesystem # FIXME: We should be passing in a MockFileSystem instead.
- self.lock_file_path_prefix = self.filesystem.join(self.http_lock._lock_path, self.http_lock._lock_file_prefix)
- self.lock_file_name = self.lock_file_path_prefix + "0"
- self.guard_lock_file = self.http_lock._guard_lock_file
- self.clean_all_lockfile()
- unittest.TestCase.__init__(self, testFunc)
-
- def clean_all_lockfile(self):
- if self.filesystem.exists(self.guard_lock_file):
- self.filesystem.remove(self.guard_lock_file)
- lock_list = self.filesystem.glob(self.lock_file_path_prefix + '*')
- for file_name in lock_list:
- self.filesystem.remove(file_name)
-
- def assertEqual(self, first, second):
- if first != second:
- self.clean_all_lockfile()
- unittest.TestCase.assertEqual(self, first, second)
-
- def _check_lock_file(self):
- if self.filesystem.exists(self.lock_file_name):
- pid = os.getpid()
- lock_file_pid = self.filesystem.read_text_file(self.lock_file_name)
- self.assertEqual(pid, int(lock_file_pid))
- return True
- return False
-
- def test_lock_lifecycle(self):
- self.http_lock._create_lock_file()
-
- self.assertEqual(True, self._check_lock_file())
- self.assertEqual(1, self.http_lock._next_lock_number())
-
- self.http_lock.cleanup_http_lock()
-
- self.assertEqual(False, self._check_lock_file())
- self.assertEqual(0, self.http_lock._next_lock_number())
-
-
-class HttpLockTest(unittest.TestCase):
- def setUp(self):
- self.filesystem = MockFileSystem()
- self.http_lock = HttpLock(None, "WebKitTestHttpd.lock.", "WebKitTest.lock", filesystem=self.filesystem, executive=MockExecutive())
- # FIXME: Shouldn't we be able to get these values from the http_lock object directly?
- self.lock_file_path_prefix = self.filesystem.join(self.http_lock._lock_path, self.http_lock._lock_file_prefix)
- self.lock_file_name = self.lock_file_path_prefix + "0"
-
- def test_current_lock_pid(self):
- # FIXME: Once Executive wraps getpid, we can mock this and not use a real pid.
- current_pid = os.getpid()
- self.http_lock._filesystem.write_text_file(self.lock_file_name, str(current_pid))
- self.assertEqual(self.http_lock._current_lock_pid(), current_pid)
-
- def test_extract_lock_number(self):
- lock_file_list = (
- self.lock_file_path_prefix + "00",
- self.lock_file_path_prefix + "9",
- self.lock_file_path_prefix + "001",
- self.lock_file_path_prefix + "021",
- )
-
- expected_number_list = (0, 9, 1, 21)
-
- for lock_file, expected in zip(lock_file_list, expected_number_list):
- self.assertEqual(self.http_lock._extract_lock_number(lock_file), expected)
-
- def test_lock_file_list(self):
- self.http_lock._filesystem = MockFileSystem({
- self.lock_file_path_prefix + "6": "",
- self.lock_file_path_prefix + "1": "",
- self.lock_file_path_prefix + "4": "",
- self.lock_file_path_prefix + "3": "",
- })
-
- expected_file_list = [
- self.lock_file_path_prefix + "1",
- self.lock_file_path_prefix + "3",
- self.lock_file_path_prefix + "4",
- self.lock_file_path_prefix + "6",
- ]
-
- self.assertEqual(self.http_lock._lock_file_list(), expected_file_list)
</del></span></pre></div>
<a id="trunkToolsScriptswebkitpyportiospy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/ios.py (177027 => 177028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/ios.py        2014-12-09 19:08:43 UTC (rev 177027)
+++ trunk/Tools/Scripts/webkitpy/port/ios.py        2014-12-09 19:32:54 UTC (rev 177028)
</span><span class="lines">@@ -210,12 +210,6 @@
</span><span class="cx"> self._executive.popen([self.path_to_script('run-safari')] + self._arguments_for_configuration() + ['--no-saved-state', '-NSOpen', results_filename],
</span><span class="cx"> cwd=self.webkit_base(), stdout=file(os.devnull), stderr=file(os.devnull))
</span><span class="cx">
</span><del>- def acquire_http_lock(self):
- pass
-
- def release_http_lock(self):
- pass
-
</del><span class="cx"> def sample_file_path(self, name, pid):
</span><span class="cx"> return self._filesystem.join(self.results_directory(), "{0}-{1}-sample.txt".format(name, pid))
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportmacpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/mac.py (177027 => 177028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/mac.py        2014-12-09 19:08:43 UTC (rev 177027)
+++ trunk/Tools/Scripts/webkitpy/port/mac.py        2014-12-09 19:32:54 UTC (rev 177028)
</span><span class="lines">@@ -190,23 +190,6 @@
</span><span class="cx"> self._executive.popen([self.path_to_script('run-safari')] + self._arguments_for_configuration() + ['--no-saved-state', '-NSOpen', results_filename],
</span><span class="cx"> cwd=self.webkit_base(), stdout=file(os.devnull), stderr=file(os.devnull))
</span><span class="cx">
</span><del>- # FIXME: The next two routines turn off the http locking in order
- # to work around failures on the bots caused when the slave restarts.
- # See https://bugs.webkit.org/show_bug.cgi?id=64886 for more info.
- # The proper fix is to make sure the slave is actually stopping NRWT
- # properly on restart. Note that by removing the lock file and not waiting,
- # the result should be that if there is a web server already running,
- # it'll be killed and this one will be started in its place; this
- # may lead to weird things happening in the other run. However, I don't
- # think we're (intentionally) actually running multiple runs concurrently
- # on any Mac bots.
-
- def acquire_http_lock(self):
- pass
-
- def release_http_lock(self):
- pass
-
</del><span class="cx"> def sample_file_path(self, name, pid):
</span><span class="cx"> return self._filesystem.join(self.results_directory(), "{0}-{1}-sample.txt".format(name, pid))
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportmock_drtpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/mock_drt.py (177027 => 177028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/mock_drt.py        2014-12-09 19:08:43 UTC (rev 177027)
+++ trunk/Tools/Scripts/webkitpy/port/mock_drt.py        2014-12-09 19:32:54 UTC (rev 177028)
</span><span class="lines">@@ -109,9 +109,6 @@
</span><span class="cx"> def start_websocket_server(self):
</span><span class="cx"> pass
</span><span class="cx">
</span><del>- def acquire_http_lock(self):
- pass
-
</del><span class="cx"> def stop_helper(self):
</span><span class="cx"> pass
</span><span class="cx">
</span><span class="lines">@@ -121,9 +118,6 @@
</span><span class="cx"> def stop_websocket_server(self):
</span><span class="cx"> pass
</span><span class="cx">
</span><del>- def release_http_lock(self):
- pass
-
</del><span class="cx"> def show_results_html_file(self, results_filename):
</span><span class="cx"> pass
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportmock_drt_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/mock_drt_unittest.py (177027 => 177028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/mock_drt_unittest.py        2014-12-09 19:08:43 UTC (rev 177027)
+++ trunk/Tools/Scripts/webkitpy/port/mock_drt_unittest.py        2014-12-09 19:32:54 UTC (rev 177028)
</span><span class="lines">@@ -65,9 +65,6 @@
</span><span class="cx"> def test_uses_apache(self):
</span><span class="cx"> pass
</span><span class="cx">
</span><del>- def integration_test_http_lock(self):
- pass
-
</del><span class="cx"> def integration_test_start_helper(self):
</span><span class="cx"> pass
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportport_testcasepy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/port_testcase.py (177027 => 177028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/port_testcase.py        2014-12-09 19:08:43 UTC (rev 177027)
+++ trunk/Tools/Scripts/webkitpy/port/port_testcase.py        2014-12-09 19:32:54 UTC (rev 177028)
</span><span class="lines">@@ -129,12 +129,6 @@
</span><span class="cx"> finally:
</span><span class="cx"> test_socket.close()
</span><span class="cx">
</span><del>- def integration_test_http_lock(self):
- port = self.make_port()
- # Only checking that no exception is raised.
- port.acquire_http_lock()
- port.release_http_lock()
-
</del><span class="cx"> def integration_test_check_sys_deps(self):
</span><span class="cx"> port = self.make_port()
</span><span class="cx"> # Only checking that no exception is raised.
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyporttestpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/test.py (177027 => 177028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/test.py        2014-12-09 19:08:43 UTC (rev 177027)
+++ trunk/Tools/Scripts/webkitpy/port/test.py        2014-12-09 19:32:54 UTC (rev 177028)
</span><span class="lines">@@ -469,18 +469,12 @@
</span><span class="cx"> def start_websocket_server(self):
</span><span class="cx"> pass
</span><span class="cx">
</span><del>- def acquire_http_lock(self):
- pass
-
</del><span class="cx"> def stop_http_server(self):
</span><span class="cx"> pass
</span><span class="cx">
</span><span class="cx"> def stop_websocket_server(self):
</span><span class="cx"> pass
</span><span class="cx">
</span><del>- def release_http_lock(self):
- pass
-
</del><span class="cx"> def _path_to_lighttpd(self):
</span><span class="cx"> return "/usr/sbin/lighttpd"
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>