瀏覽代碼

ZOOKEEPER-524. DBSizeTest is not really testing anything

git-svn-id: https://svn.apache.org/repos/asf/hadoop/zookeeper/trunk@912052 13f79535-47bb-0310-9956-ffa450edef68
Benjamin Reed 15 年之前
父節點
當前提交
a48ea12e5c
共有 2 個文件被更改,包括 2 次插入87 次删除
  1. 2 0
      CHANGES.txt
  2. 0 87
      src/java/test/org/apache/zookeeper/test/DBSizeTest.java

+ 2 - 0
CHANGES.txt

@@ -7,6 +7,8 @@ BUGFIXES:
 Backward compatible changes:
 
 BUGFIXES: 
+  ZOOKEEPER-524. DBSizeTest is not really testing anything (breed)
+
   ZOOKEEPER-469. make sure CPPUNIT_CFLAGS isn't overwritten
   (chris via mahadev)
 

+ 0 - 87
src/java/test/org/apache/zookeeper/test/DBSizeTest.java

@@ -1,87 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.zookeeper.test;
-
-import java.io.IOException;
-
-import org.apache.zookeeper.AsyncCallback;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.ZooKeeper;
-import org.apache.zookeeper.ZooDefs.Ids;
-import org.junit.Test;
-
-public class DBSizeTest extends ClientBase {
-    String snapCount;
-    @Override
-    protected void setUp() throws Exception {
-        // Change the snapcount to happen more often
-        snapCount = System.getProperty("zookeeper.snapCount", "1024");
-        System.setProperty("zookeeper.snapCount", "10");
-        super.setUp();
-    }
-    
-
-    @Override
-    protected void tearDown() throws Exception {
-        System.setProperty("zookeeper.snapCount", snapCount);
-        super.tearDown();
-    }
-
-
-    // Test that the latency of requests doesn't increase with
-    // the size of the database
-    @Test
-    public void testDBScale()
-        throws IOException, InterruptedException, KeeperException
-    {
-        String path = "/SIZE";
-        byte data[] = new byte[1024];
-        ZooKeeper zk = null;
-        try {
-            zk = createClient();
-            long startTime = System.currentTimeMillis();
-            zk.create(path, data, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
-            long baseLatency = System.currentTimeMillis() - startTime;
-            
-            for(int i = 0; i < 1 /* was 16 */; i++) {
-                startTime = System.currentTimeMillis();
-                zk.create(path + '/' + i, data, Ids.OPEN_ACL_UNSAFE,
-                        CreateMode.PERSISTENT);
-                long latency = System.currentTimeMillis() - startTime;
-                System.out.println("Latency = " + latency);
-                //assertTrue(latency < baseLatency + 10);
-                for(int j = 0; j < 1024; j++) {
-                    zk.create(path + '/' + i + '/' + j, data, Ids.OPEN_ACL_UNSAFE, 
-                            CreateMode.EPHEMERAL, new AsyncCallback.StringCallback() {
-                        public void processResult(int rc, String path,
-                                Object ctx, String name) {
-                            // empty
-                        }}, null);
-                }
-            }
-        } finally {
-            if (zk != null) {
-                zk.close();
-            }
-        }
-    }
-
-
-}