[ARVADOS] updated: 2a30eaccec6497cce95413dbae1fcddbdfdd728f

Git user git at public.curoverse.com
Wed Feb 22 16:34:21 EST 2017


Summary of changes:
 sdk/python/tests/run_test_server.py | 9 +++++++++
 1 file changed, 9 insertions(+)

       via  2a30eaccec6497cce95413dbae1fcddbdfdd728f (commit)
      from  0c529ed05805507b4d2c903b9587e9b61cec5ee6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 2a30eaccec6497cce95413dbae1fcddbdfdd728f
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Feb 22 16:33:35 2017 -0500

    Remove pidfiles after shutting down test servers.
    
    No issue #

diff --git a/sdk/python/tests/run_test_server.py b/sdk/python/tests/run_test_server.py
index b969b12..776ff72 100644
--- a/sdk/python/tests/run_test_server.py
+++ b/sdk/python/tests/run_test_server.py
@@ -109,6 +109,7 @@ def kill_server_pid(pidfile, wait=10, passenger_root=False):
         try:
             exited, _ = os.waitpid(server_pid, os.WNOHANG)
             if exited > 0:
+                _remove_pidfile(pidfile)
                 return
         except OSError:
             # already exited, or isn't our child process
@@ -122,6 +123,7 @@ def kill_server_pid(pidfile, wait=10, passenger_root=False):
             if error.errno == errno.ESRCH:
                 # Thrown by os.getpgid() or os.kill() if the process
                 # does not exist, i.e., our work here is done.
+                _remove_pidfile(pidfile)
                 return
             raise
         time.sleep(0.1)
@@ -131,6 +133,13 @@ def kill_server_pid(pidfile, wait=10, passenger_root=False):
           format(server_pid, pidfile, wait),
           file=sys.stderr)
 
+def _remove_pidfile(pidfile):
+    try:
+        os.unlink(pidfile)
+    except:
+        if os.path.lexists(pidfile):
+            raise
+
 def find_available_port():
     """Return an IPv4 port number that is not in use right now.
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list