Author: eevans
Date: Thu Jul 9 17:38:42 2009
New Revision: 792615
URL: http://svn.apache.org/viewvc?rev=792615&view=rev
Log:
abort system tests if previous run shutdown uncleanly
Patch by eevans; reviewed by Michael Greene for CASSANDRA-282
Modified:
incubator/cassandra/trunk/test/system/__init__.py
Modified: incubator/cassandra/trunk/test/system/__init__.py
URL:
http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/system/__init__.py?rev=792615&r1=792614&r2=792615&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/system/__init__.py (original)
+++ incubator/cassandra/trunk/test/system/__init__.py Thu Jul 9 17:38:42 2009
@@ -42,8 +42,7 @@
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 @@
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 @@
# 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