accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject svn commit: r1405493 - /accumulo/trunk/test/system/bench/lib/IngestBenchmark.py
Date Sun, 04 Nov 2012 03:01:15 GMT
Author: elserj
Date: Sun Nov  4 03:01:15 2012
New Revision: 1405493

URL: http://svn.apache.org/viewvc?rev=1405493&view=rev
Log:
ACCUMULO-827 Fix IngestBenchmark to properly create/delete its table

Modified:
    accumulo/trunk/test/system/bench/lib/IngestBenchmark.py

Modified: accumulo/trunk/test/system/bench/lib/IngestBenchmark.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/bench/lib/IngestBenchmark.py?rev=1405493&r1=1405492&r2=1405493&view=diff
==============================================================================
--- accumulo/trunk/test/system/bench/lib/IngestBenchmark.py (original)
+++ accumulo/trunk/test/system/bench/lib/IngestBenchmark.py Sun Nov  4 03:01:15 2012
@@ -30,14 +30,21 @@ class IngestBenchmark(Benchmark):
 
     def setUp(self):
         code, out, err = cloudshell.run(self.username, self.password, 'table test_ingest\n')
-        if out.find('no such table') >= 0:
+        if out.find('does not exist') == -1:
             log.debug("Deleting table test_ingest")
-            code, out, err = cloudshell.run(self.username, self.password, 'deletetable test_ingest\n')
-            self.sleep(10)
+            code, out, err = cloudshell.run(self.username, self.password, 'deletetable test_ingest
-f\n')
+            self.assertEquals(code, 0, "Could not delete the table 'test_ingest'")
         code, out, err = cloudshell.run(self.username, self.password, 'createtable test_ingest\n')
-        self.assertEqual(code, 0)
+        self.assertEqual(code, 0, "Could not create the table 'test_ingest'")
         Benchmark.setUp(self)
 
+    def tearDown(self):
+        command = 'deletetable test_ingest -f\n'
+        log.debug("Running Command %r", command)
+        code, out, err = cloudshell.run(self.username, self.password, command)
+        self.assertEqual(code, 0, "Could not delete the table 'test_ingest'")
+        Benchmark.tearDown(self)
+
     def size(self):
         return 50
 
@@ -67,10 +74,6 @@ class IngestBenchmark(Benchmark):
         for code, slaves in codes.items():
             if code != 0:
                 self.assertEqual(code, 0, "Bad exit code (%d) from slaves %r" % (code, slaves))
-        command = 'deletetable test_ingest\n'
-        log.debug("Running Command %r", command)
-        code, out, err = cloudshell.run(self.username, self.password, command)
-        # print err
 
     def score(self):
         if self.finished:



Mime
View raw message