accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1324864 - in /accumulo/trunk: ./ core/ server/ server/src/main/java/org/apache/accumulo/server/test/functional/ server/src/main/java/org/apache/accumulo/server/test/performance/thrift/ test/system/auto/ test/system/auto/simple/ test/system...
Date Wed, 11 Apr 2012 16:56:43 GMT
Author: ecn
Date: Wed Apr 11 16:56:42 2012
New Revision: 1324864

URL: http://svn.apache.org/viewvc?rev=1324864&view=rev
Log:
ACCUMULO-521 ACCUMULO-522 ACCUMULO-523 ACCUMULO-524: merge to trunk

Added:
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/functional/ZombieTServer.java
      - copied, changed from r1324771, accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/functional/ZombieTServer.java
Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/performance/thrift/NullTserver.java
    accumulo/trunk/test/system/auto/run.py
    accumulo/trunk/test/system/auto/simple/deleterows.py
    accumulo/trunk/test/system/auto/simple/dynamic.py
    accumulo/trunk/test/system/auto/simple/examples.py
    accumulo/trunk/test/system/auto/simple/zooCacheTest.py
    accumulo/trunk/test/system/auto/stress/weird.py

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/src:r1324771
  Merged /accumulo/branches/1.4:r1324771,1324796,1324804,1324817,1324850,1324852

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/core:r1324771,1324796,1324804,1324817,1324850,1324852
  Merged /accumulo/branches/1.4/src/core:r1324771

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/server:r1324771,1324796,1324804,1324817,1324850,1324852
  Merged /accumulo/branches/1.4/src/server:r1324771

Copied: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/functional/ZombieTServer.java
(from r1324771, accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/functional/ZombieTServer.java)
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/functional/ZombieTServer.java?p2=accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/functional/ZombieTServer.java&p1=accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/functional/ZombieTServer.java&r1=1324771&r2=1324864&rev=1324864&view=diff
==============================================================================
--- accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/functional/ZombieTServer.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/functional/ZombieTServer.java
Wed Apr 11 16:56:42 2012
@@ -23,6 +23,7 @@ import java.util.Random;
 
 import org.apache.accumulo.cloudtrace.thrift.TInfo;
 import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.master.thrift.TableInfo;
 import org.apache.accumulo.core.master.thrift.TabletServerStatus;
 import org.apache.accumulo.core.security.thrift.AuthInfo;
@@ -56,8 +57,8 @@ public class ZombieTServer {
     
     boolean halted = false;
 
-    ThriftClientHandler(TransactionWatcher watcher) {
-      super(watcher);
+    ThriftClientHandler(Instance instance, TransactionWatcher watcher) {
+      super(instance, watcher);
     }
     
     @Override
@@ -91,15 +92,16 @@ public class ZombieTServer {
     final Logger log = Logger.getLogger(ZombieTServer.class);
     Random random = new Random(System.currentTimeMillis() % 1000);
     int port = random.nextInt(30000) + 2000;
+    Instance instance = HdfsZooInstance.getInstance();
     
     TransactionWatcher watcher = new TransactionWatcher();
-    final ThriftClientHandler tch = new ThriftClientHandler(watcher);
+    final ThriftClientHandler tch = new ThriftClientHandler(instance, watcher);
     TabletClientService.Processor processor = new TabletClientService.Processor(tch);
     ServerPort serverPort = TServerUtils.startTServer(port, processor, "ZombieTServer", "walking
dead", 2, 1000);
     
     InetSocketAddress addr = new InetSocketAddress(InetAddress.getLocalHost(), serverPort.port);
     String addressString = AddressUtil.toString(addr);
-    String zPath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZTSERVERS +
"/" + addressString;
+    String zPath = ZooUtil.getRoot(instance) + Constants.ZTSERVERS + "/" + addressString;
     ZooReaderWriter zoo = ZooReaderWriter.getInstance();
     zoo.putPersistentData(zPath, new byte[] {}, NodeExistsPolicy.SKIP);
     

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/performance/thrift/NullTserver.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/performance/thrift/NullTserver.java?rev=1324864&r1=1324863&r2=1324864&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/performance/thrift/NullTserver.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/performance/thrift/NullTserver.java
Wed Apr 11 16:56:42 2012
@@ -72,11 +72,11 @@ import org.apache.thrift.TException;
 
 public class NullTserver {
   
-  private static class ThriftClientHandler extends ClientServiceHandler implements TabletClientService.Iface
{
+  public static class ThriftClientHandler extends ClientServiceHandler implements TabletClientService.Iface
{
     
     private long updateSession = 1;
     
-    ThriftClientHandler(Instance instance, TransactionWatcher watcher) {
+    public ThriftClientHandler(Instance instance, TransactionWatcher watcher) {
       super(instance, watcher);
     }
     

Modified: accumulo/trunk/test/system/auto/run.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/run.py?rev=1324864&r1=1324863&r2=1324864&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/run.py (original)
+++ accumulo/trunk/test/system/auto/run.py Wed Apr 11 16:56:42 2012
@@ -264,6 +264,10 @@ def main():
 
     assignOptions(filtered, options)
 
+    if not os.environ.get('ZOOKEEPER_HOME', None):
+       print "ZOOKEEPER_HOME needs to be set"
+       sys.exit(1)
+
     runner = TestRunner()
     
     suite = unittest.TestSuite()

Modified: accumulo/trunk/test/system/auto/simple/deleterows.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/simple/deleterows.py?rev=1324864&r1=1324863&r2=1324864&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/simple/deleterows.py (original)
+++ accumulo/trunk/test/system/auto/simple/deleterows.py Wed Apr 11 16:56:42 2012
@@ -26,6 +26,7 @@ class DeleteRowsTest(JavaTest):
 class DeleteRowsSplitTest(JavaTest):
     "Test Delete Rows Split"
 
+    maxRuntime = 180
     order = 92
     testClass="org.apache.accumulo.server.test.functional.DeleteRowsSplitTest"
 

Modified: accumulo/trunk/test/system/auto/simple/dynamic.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/simple/dynamic.py?rev=1324864&r1=1324863&r2=1324864&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/simple/dynamic.py (original)
+++ accumulo/trunk/test/system/auto/simple/dynamic.py Wed Apr 11 16:56:42 2012
@@ -67,9 +67,13 @@ public class StringSummation%s implement
 ''' % rand)
         fp.close()
 
+        handle = self.runOn(self.masterHost(), [self.accumulo_sh(), 'classpath'])
+        out, err = handle.communicate()
+        path = ':'.join(out.split('\n')[1:])
+
         self.runWait("javac -cp %s:%s %s" % (
+            path,
             os.path.join(ACCUMULO_HOME,'src','core','target','classes'),
-            glob.glob(os.path.join(ACCUMULO_HOME,'lib','accumulo-core*.jar'))[0],
             os.path.join(ACCUMULO_HOME,'target','dynamictest%s' % rand,'accumulo','test','StringSummation%s.java'
% rand)
             ))
         self.runWait("jar -cf %s -C %s accumulo/" % (

Modified: accumulo/trunk/test/system/auto/simple/examples.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/simple/examples.py?rev=1324864&r1=1324863&r2=1324864&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/simple/examples.py (original)
+++ accumulo/trunk/test/system/auto/simple/examples.py Wed Apr 11 16:56:42 2012
@@ -95,17 +95,17 @@ class Examples(TestUtilsMixin, unittest.
 
         self.comment("Testing bloom filters are fast for missing data")
         self.ashell('createtable bloom_test\nconfig -t bloom_test -s table.bloom.enabled=true\n')
-        self.execute(self.accumulo_sh(), 'org.apache.accumulo.examples.client.RandomBatchWriter',
'-s', '7',
+        self.execute(self.accumulo_sh(), 'org.apache.accumulo.examples.simple.client.RandomBatchWriter',
'-s', '7',
                      INSTANCE_NAME, ZOOKEEPERS, ROOT, ROOT_PASSWORD, 'bloom_test',
                      '1000000', '0', '1000000000', '50', '2000000', '60000', '3' 'A')
         self.ashell('flush -t bloom_test -w\n')
         now = time.time()
-        self.execute(self.accumulo_sh(), 'org.apache.accumulo.examples.client.RandomBatchScanner',
'-s', '7',
+        self.execute(self.accumulo_sh(), 'org.apache.accumulo.examples.simple.client.RandomBatchScanner',
'-s', '7',
                      INSTANCE_NAME, ZOOKEEPERS, ROOT, ROOT_PASSWORD, 'bloom_test',
                      500, 0, 1000000000, 50, 20, 'A')
         diff = time.time() - now
         now = time.time()
-        self.execute(self.accumulo_sh(), 'org.apache.accumulo.examples.client.RandomBatchScanner',
'-s', '8',
+        self.execute(self.accumulo_sh(), 'org.apache.accumulo.examples.simple.client.RandomBatchScanner',
'-s', '8',
                      INSTANCE_NAME, ZOOKEEPERS, ROOT, ROOT_PASSWORD, 'bloom_test',
                      500, 0, 1000000000, 50, 20, 'A')
         diff2 = time.time() - now
@@ -114,28 +114,28 @@ class Examples(TestUtilsMixin, unittest.
         self.comment("Creating a sharded index of the accumulo java files")
         self.ashell('createtable shard\ncreatetable doc2term\nquit\n')
         self.execute('/bin/sh', '-c',
-                     'find src -name "*.java" | xargs ./bin/accumulo org.apache.accumulo.examples.shard.Index
%s %s shard %s %s 30' %
+                     'find src -name "*.java" | xargs ./bin/accumulo org.apache.accumulo.simple.examples.shard.Index
%s %s shard %s %s 30' %
                      (INSTANCE_NAME, ZOOKEEPERS, ROOT, ROOT_PASSWORD))
-        self.execute(self.accumulo_sh(), 'org.apache.accumulo.examples.shard.Query',
+        self.execute(self.accumulo_sh(), 'org.apache.accumulo.simple.examples.shard.Query',
                      INSTANCE_NAME, ZOOKEEPERS, 'shard', ROOT, ROOT_PASSWORD,
                      'foo', 'bar')
         self.comment("Creating a word index of the sharded files")
-        self.execute(self.accumulo_sh(), 'org.apache.accumulo.examples.shard.Reverse',
+        self.execute(self.accumulo_sh(), 'org.apache.accumulo.simple.examples.shard.Reverse',
                      INSTANCE_NAME, ZOOKEEPERS, 'shard', 'doc2term', ROOT, ROOT_PASSWORD)
         self.comment("Making 1000 conjunctive queries of 5 random words")
-        self.execute(self.accumulo_sh(), 'org.apache.accumulo.examples.shard.ContinuousQuery',
+        self.execute(self.accumulo_sh(), 'org.apache.accumulo.simple.examples.shard.ContinuousQuery',
                      INSTANCE_NAME, ZOOKEEPERS, 'shard', 'doc2term', ROOT, ROOT_PASSWORD,
5, 1000)
 
         self.execute('hadoop', 'fs', '-rmr', "/tmp/input", "/tmp/files", "/tmp/splits.txt",
"/tmp/failures")
         self.execute('hadoop', 'fs', '-mkdir', "/tmp/input")
         self.comment("Starting bulk ingest example")
         self.comment("   Creating some test data")
-        self.execute(self.accumulo_sh(), 'org.apache.accumulo.examples.mapreduce.bulk.GenerateTestData',
0, 1000000, '/tmp/input/data')
-        self.execute(self.accumulo_sh(), 'org.apache.accumulo.examples.mapreduce.bulk.SetupTable',
+        self.execute(self.accumulo_sh(), 'org.apache.accumulo.simple.examples.mapreduce.bulk.GenerateTestData',
0, 1000000, '/tmp/input/data')
+        self.execute(self.accumulo_sh(), 'org.apache.accumulo.simple.examples.mapreduce.bulk.SetupTable',
                  INSTANCE_NAME, ZOOKEEPERS, ROOT, ROOT_PASSWORD, 'bulkTable')
-        self.execute(ACCUMULO_HOME+'/bin/tool.sh', examplesJar, 'org.apache.accumulo.examples.mapreduce.bulk.BulkIngestExample',
+        self.execute(ACCUMULO_HOME+'/bin/tool.sh', examplesJar, 'org.apache.accumulo.simple.examples.mapreduce.bulk.BulkIngestExample',
                  INSTANCE_NAME, ZOOKEEPERS, ROOT, ROOT_PASSWORD, 'bulkTable', '/tmp/input',
'/tmp')
-        self.execute(ACCUMULO_HOME+'/bin/tool.sh', examplesJar, 'org.apache.accumulo.examples.mapreduce.bulk.VerifyIngest',
+        self.execute(ACCUMULO_HOME+'/bin/tool.sh', examplesJar, 'org.apache.accumulo.simple.examples.mapreduce.bulk.VerifyIngest',
                  INSTANCE_NAME, ZOOKEEPERS, ROOT, ROOT_PASSWORD, 'bulkTable', 0, 1000000)
         self.wait(self.runOn(self.masterHost(), [
             'hadoop', 'fs', '-rmr', "/tmp/tableFile", "/tmp/nines"
@@ -146,7 +146,7 @@ class Examples(TestUtilsMixin, unittest.
         self.wait(self.runOn(self.masterHost(), [
             ACCUMULO_HOME+'/bin/tool.sh',
             examplesJar,
-            'org.apache.accumulo.examples.mapreduce.TeraSortIngest',
+            'org.apache.accumulo.simple.examples.mapreduce.TeraSortIngest',
             ROWS,  
             10, 10,
             78, 78,
@@ -160,7 +160,7 @@ class Examples(TestUtilsMixin, unittest.
         self.wait(self.runOn(self.masterHost(), [
             ACCUMULO_HOME+'/bin/tool.sh',
             examplesJar,
-            'org.apache.accumulo.examples.mapreduce.RegexExample',
+            'org.apache.accumulo.simple.examples.mapreduce.RegexExample',
             INSTANCE_NAME,
             ZOOKEEPERS,
             ROOT,
@@ -175,7 +175,7 @@ class Examples(TestUtilsMixin, unittest.
         self.wait(self.runOn(self.masterHost(), [
             ACCUMULO_HOME+'/bin/tool.sh',
             examplesJar,
-            'org.apache.accumulo.examples.mapreduce.RowHash',
+            'org.apache.accumulo.simple.examples.mapreduce.RowHash',
             INSTANCE_NAME,
             ZOOKEEPERS,
             ROOT,
@@ -188,7 +188,7 @@ class Examples(TestUtilsMixin, unittest.
         self.wait(self.runOn(self.masterHost(), [
             ACCUMULO_HOME+'/bin/tool.sh',
             examplesJar,
-            'org.apache.accumulo.examples.mapreduce.TableToFile',
+            'org.apache.accumulo.simple.examples.mapreduce.TableToFile',
             INSTANCE_NAME,
             ZOOKEEPERS,
             ROOT,
@@ -211,28 +211,28 @@ class Examples(TestUtilsMixin, unittest.
         self.wait(self.runOn(self.masterHost(), [
             ACCUMULO_HOME+'/bin/tool.sh',
             examplesJar,
-            'org.apache.accumulo.examples.mapreduce.WordCount',
+            'org.apache.accumulo.simple.examples.mapreduce.WordCount',
             INSTANCE_NAME,
             ZOOKEEPERS,
             '/tmp/wc',
             'wctable'
             ]))
         self.comment("Inserting data with a batch writer")
-        self.runExample(['org.apache.accumulo.examples.helloworld.InsertWithBatchWriter',
+        self.runExample(['org.apache.accumulo.simple.examples.helloworld.InsertWithBatchWriter',
                         INSTANCE_NAME,
                         ZOOKEEPERS,
                         'helloBatch',
                         ROOT,
                         ROOT_PASSWORD])
         self.comment("Reading data")
-        self.runExample(['org.apache.accumulo.examples.helloworld.ReadData',
+        self.runExample(['org.apache.accumulo.simple.examples.helloworld.ReadData',
                          INSTANCE_NAME,
                          ZOOKEEPERS,
                         'helloBatch',
                          ROOT,
                          ROOT_PASSWORD])
         self.comment("Running isolated scans")
-        self.runExample(['org.apache.accumulo.examples.isolation.InterferenceTest',
+        self.runExample(['org.apache.accumulo.simple.examples.isolation.InterferenceTest',
                          INSTANCE_NAME,
                          ZOOKEEPERS,
                          ROOT,
@@ -241,7 +241,7 @@ class Examples(TestUtilsMixin, unittest.
                          100000,
                          'true'])
         self.comment("Running scans without isolation")
-        self.runExample(['org.apache.accumulo.examples.isolation.InterferenceTest',
+        self.runExample(['org.apache.accumulo.simple.examples.isolation.InterferenceTest',
                          INSTANCE_NAME,
                          ZOOKEEPERS,
                          ROOT,
@@ -250,7 +250,7 @@ class Examples(TestUtilsMixin, unittest.
                          100000,
                          'false'])
         self.comment("Inserting data using a map/reduce job")
-        self.runExample(['org.apache.accumulo.examples.helloworld.InsertWithOutputFormat',
+        self.runExample(['org.apache.accumulo.simple.examples.helloworld.InsertWithOutputFormat',
                          INSTANCE_NAME,
                          ZOOKEEPERS,
                         'helloOutputFormat',
@@ -259,21 +259,21 @@ class Examples(TestUtilsMixin, unittest.
         self.comment("Using some example constraints")
         self.ashell('\n'.join([
             'createtable testConstraints',
-            'config -t testConstraints -s table.constraint.1=org.apache.accumulo.examples.constraints.NumericValueConstraint',
-            'config -t testConstraints -s table.constraint.2=org.apache.accumulo.examples.constraints.AlphaNumKeyConstraint',
+            'config -t testConstraints -s table.constraint.1=org.apache.accumulo.simple.examples.constraints.NumericValueConstraint',
+            'config -t testConstraints -s table.constraint.2=org.apache.accumulo.simple.examples.constraints.AlphaNumKeyConstraint',
             'insert r1 cf1 cq1 1111',
             'insert r1 cf1 cq1 ABC',
             'scan',
             'quit'
             ]))
         self.comment("Performing some row operations")
-        self.runExample(['org.apache.accumulo.examples.client.RowOperations', 
+        self.runExample(['org.apache.accumulo.simple.examples.client.RowOperations', 
                            INSTANCE_NAME,
                            ZOOKEEPERS,
                            ROOT,
                            ROOT_PASSWORD])
         self.comment("Using the batch writer")
-        self.runExample(['org.apache.accumulo.examples.client.SequentialBatchWriter',
+        self.runExample(['org.apache.accumulo.simple.examples.client.SequentialBatchWriter',
                            INSTANCE_NAME, 
                            ZOOKEEPERS, 
                            ROOT, 
@@ -287,7 +287,7 @@ class Examples(TestUtilsMixin, unittest.
                            numThreads,
                            visibility])
         self.comment("Reading and writing some data")
-        self.runExample(['org.apache.accumulo.examples.client.ReadWriteExample',
+        self.runExample(['org.apache.accumulo.simple.examples.client.ReadWriteExample',
                            '-i', INSTANCE_NAME, 
                            '-z', ZOOKEEPERS, 
                            '-u', ROOT, 
@@ -298,7 +298,7 @@ class Examples(TestUtilsMixin, unittest.
                            '-r', 
                            '-dbg'])
         self.comment("Deleting some data")
-        self.runExample(['org.apache.accumulo.examples.client.ReadWriteExample',
+        self.runExample(['org.apache.accumulo.simple.examples.client.ReadWriteExample',
                            '-i', INSTANCE_NAME, 
                            '-z', ZOOKEEPERS, 
                            '-u', ROOT, 
@@ -308,7 +308,7 @@ class Examples(TestUtilsMixin, unittest.
                            '-d', 
                            '-dbg'])
         self.comment("Writing some random data with the batch writer")
-        self.runExample(['org.apache.accumulo.examples.client.RandomBatchWriter',
+        self.runExample(['org.apache.accumulo.simple.examples.client.RandomBatchWriter',
                            INSTANCE_NAME, 
                            ZOOKEEPERS, 
                            ROOT, 
@@ -323,7 +323,7 @@ class Examples(TestUtilsMixin, unittest.
                            numThreads, 
                            visibility])
         self.comment("Writing some random data with the batch writer")
-        self.runExample(['org.apache.accumulo.examples.client.RandomBatchScanner',
+        self.runExample(['org.apache.accumulo.simple.examples.client.RandomBatchScanner',
                            INSTANCE_NAME, 
                            ZOOKEEPERS, 
                            ROOT, 
@@ -336,7 +336,7 @@ class Examples(TestUtilsMixin, unittest.
                            numThreads, 
                            auths]);
         self.comment("Running an example table operation (Flush)")
-        self.runExample(['org.apache.accumulo.examples.client.Flush',
+        self.runExample(['org.apache.accumulo.simple.examples.client.Flush',
                            INSTANCE_NAME,
                            ZOOKEEPERS,
                            ROOT,

Modified: accumulo/trunk/test/system/auto/simple/zooCacheTest.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/simple/zooCacheTest.py?rev=1324864&r1=1324863&r2=1324864&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/simple/zooCacheTest.py (original)
+++ accumulo/trunk/test/system/auto/simple/zooCacheTest.py Wed Apr 11 16:56:42 2012
@@ -36,7 +36,7 @@ class ZooCacheTest(TestUtilsMixin, unitt
         handleR2 = self.runClassOn('localhost', 'org.apache.accumulo.server.test.functional.CacheTestReader',
['/zcTest-42','/tmp/zcTest-42', ZOOKEEPERS])
         handleR3 = self.runClassOn('localhost', 'org.apache.accumulo.server.test.functional.CacheTestReader',
['/zcTest-42','/tmp/zcTest-42', ZOOKEEPERS])
         handleW = self.runClassOn('localhost', 'org.apache.accumulo.server.test.functional.CacheTestWriter',
['/zcTest-42','/tmp/zcTest-42','3','500'])
-        self.waitForStop(handleW, 60)
+        self.waitForStop(handleW, 90)
         self.waitForStop(handleR1, 1)
         self.waitForStop(handleR2, 1)
         self.waitForStop(handleR3, 1)

Modified: accumulo/trunk/test/system/auto/stress/weird.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/stress/weird.py?rev=1324864&r1=1324863&r2=1324864&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/stress/weird.py (original)
+++ accumulo/trunk/test/system/auto/stress/weird.py Wed Apr 11 16:56:42 2012
@@ -17,62 +17,29 @@ import os
 
 import logging
 import unittest
-import time
-import sys
-import signal
-import socket
 
-from TestUtils import ACCUMULO_HOME, SITE, FUZZ
-
-from simple.readwrite import SunnyDayTest
+from TestUtils import TestUtilsMixin
 
 log = logging.getLogger('test.auto')
 
-class LateLastContact(SunnyDayTest):
+class LateLastContact(unittest.TestCase, TestUtilsMixin):
     """Fake the "tablet stops talking but holds its lock" problem we see when hard drives
and NFS fail.
-    Start a tabletserver, create a fake lock, start the master, kill the tablet server.
+       Start a ZombieTServer, and see that master stops it.
     """
 
     order = 80
 
-    settings = SunnyDayTest.settings.copy()
+    settings = TestUtilsMixin.settings.copy()
+    settings['general.rpc.timeout'] = '2s'
+
+    def setUp(self):
+        TestUtilsMixin.setUp(self);
     
     def runTest(self):
-        if not os.getenv("ZOOKEEPER_HOME"):
-            self.fail("ZOOKEEPER_HOME environment variable is not set please set the location
of ZOOKEEPER home in this environment variable")
-        self.waitForStop(self.ingester, self.waitTime())
-        cfg = os.path.join(ACCUMULO_HOME, 'conf', SITE)
-        import config
-        dir = config.parse(cfg)['instance.dfs.dir']
-
-        handle = self.runOn(self.masterHost(),
-                            ["hadoop","dfs","-ls", dir +"/instance_id"])
+        handle = self.runClassOn(self.masterHost(), 'org.apache.accumulo.server.test.functional.ZombieTServer',
[])
         out, err = handle.communicate()
-        out = out.strip()
-        instance_id = out.split("\n")[-1].split("/")[-1]
-        zkcli = os.path.join(os.getenv("ZOOKEEPER_HOME"), "bin", "zkCli.sh")
-        if not os.path.exists(zkcli):
-            zkcli = "/usr/share/zookeeper/bin/zkCli.sh"
-        myaddr = socket.getaddrinfo(socket.gethostname(), None)[0][-1][0]
-        self.wait(self.runOn(self.masterHost(),
-                             [zkcli, "-server", "localhost",
-                              "create", "-s",
-                              "/accumulo/%s/tservers/%s:%s/zlock-0" %
-                              (instance_id, myaddr, 42000),
-                              "tserver", "world:anyone:cdrw"]))
-        self.stop_tserver(self.masterHost(), signal=signal.SIGKILL)
-        log.info("Making sure the tablet server is still considered online")
-        handle = self.runClassOn(self.masterHost(), 'org.apache.accumulo.server.test.GetMasterStats',
[])
-        out, err = handle.communicate()
-        tServer = "%s:%s" % (myaddr, 39000 + FUZZ)
-        assert out.find(tServer) > 0
-        self.sleep(12)
-        log.info("Making sure the tablet server is now offline")
-        handle = self.runClassOn(self.masterHost(), 'org.apache.accumulo.server.test.GetMasterStats',
[])
-        out, err = handle.communicate()
-        assert (out.find(tServer) < 0) or (out.find(tServer) > out.find('Bad servers'))
-        
-        
+        assert handle.returncode == 0
+
 def suite():
     result = unittest.TestSuite()
     result.addTest(LateLastContact())



Mime
View raw message