From f49f3e7ea9b2b05a5c502a440376c60358b64c18 Mon Sep 17 00:00:00 2001 From: Eric Evans Date: Thu, 9 Jul 2009 17:38:42 +0000 Subject: [PATCH] abort system tests if previous run shutdown uncleanly Patch by eevans; reviewed by Michael Greene for CASSANDRA-282 git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@792615 13f79535-47bb-0310-9956-ffa450edef68 --- test/system/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/system/__init__.py b/test/system/__init__.py index 72074f1f39..986d85be1a 100644 --- a/test/system/__init__.py +++ b/test/system/__init__.py @@ -42,8 +42,7 @@ def get_client(): client = get_client() -import tempfile -_, pid_fname = tempfile.mkstemp() +pid_fname = "system_test.pid" def pid(): return int(open(pid_fname).read()) @@ -55,6 +54,11 @@ class CassandraTester(object): def setUp(self): if self.runserver: + if os.path.exists(pid_fname): + pid_path = os.path.join(root, pid_fname) + print "Unclean shutdown detected, (%s found)" % pid_path + sys.exit() + # clean out old stuff import shutil # todo get directories from conf/storage-conf.xml @@ -95,3 +99,5 @@ class CassandraTester(object): # TODO kill server with SIGKILL if it's still alive time.sleep(0.5) # TODO assert server is Truly Dead + +# vim:ai sw=4 ts=4 tw=0 et