Lion Production Test failing with error: "Failed to stop httpd: pid file still exists...
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 20:47:54 +0000 (20:47 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 20:47:54 +0000 (20:47 +0000)
Reviewed by Dirk Pranke.

Try to delete the pid file left by Apache in the case it was killed forcefully.

* Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
(LayoutTestApacheHttpd._stop_running_server):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114555 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py

index da93351..0b6b520 100644 (file)
@@ -1,3 +1,15 @@
+2012-04-18  Jer Noble  <jer.noble@apple.com>
+
+        Lion Production Test failing with error: "Failed to stop httpd: pid file still exists"
+        https://bugs.webkit.org/show_bug.cgi?id=84177
+
+        Reviewed by Dirk Pranke.
+
+        Try to delete the pid file left by Apache in the case it was killed forcefully.
+
+        * Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
+        (LayoutTestApacheHttpd._stop_running_server):
+
 2012-04-18  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
 
         Clean-up WheelEvent Conversion.
index a09aa33..fecc5ad 100644 (file)
@@ -137,6 +137,12 @@ class LayoutTestApacheHttpd(http_server_base.HttpServerBase):
         return int(self._filesystem.read_text_file(self._pid_file))
 
     def _stop_running_server(self):
+        # If apache was forcefully killed, the pid file will not have been deleted, so check
+        # that the process specified by the pid_file no longer exists before deleting the file.
+        if self._pid and not self._executive.check_running_pid(self._pid):
+            self._filesystem.remove(self._pid_file)
+            return
+
         retval, err = self._run(self._stop_cmd)
         if retval or len(err):
             raise http_server_base.ServerError('Failed to stop %s: %s' % (self._name, err))