You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flume.apache.org by hs...@apache.org on 2013/10/15 00:59:27 UTC

git commit: FLUME-2159. Remove TestNettyAvroRpcClient.spinThreadsCrazily.

Updated Branches:
  refs/heads/trunk c9ddf9370 -> 68fe4d451


FLUME-2159. Remove TestNettyAvroRpcClient.spinThreadsCrazily.

(Roshan Naik via Hari Shreedharan)


Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/68fe4d45
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/68fe4d45
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/68fe4d45

Branch: refs/heads/trunk
Commit: 68fe4d45123473adbef1077c5de20b4dd48d3a1d
Parents: c9ddf93
Author: Hari Shreedharan <hs...@apache.org>
Authored: Mon Oct 14 15:56:54 2013 -0700
Committer: Hari Shreedharan <hs...@apache.org>
Committed: Mon Oct 14 15:56:54 2013 -0700

----------------------------------------------------------------------
 .../flume/api/TestNettyAvroRpcClient.java       | 45 --------------------
 1 file changed, 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/68fe4d45/flume-ng-sdk/src/test/java/org/apache/flume/api/TestNettyAvroRpcClient.java
----------------------------------------------------------------------
diff --git a/flume-ng-sdk/src/test/java/org/apache/flume/api/TestNettyAvroRpcClient.java b/flume-ng-sdk/src/test/java/org/apache/flume/api/TestNettyAvroRpcClient.java
index 72e331b..bfb1fa6 100644
--- a/flume-ng-sdk/src/test/java/org/apache/flume/api/TestNettyAvroRpcClient.java
+++ b/flume-ng-sdk/src/test/java/org/apache/flume/api/TestNettyAvroRpcClient.java
@@ -333,49 +333,4 @@ public class TestNettyAvroRpcClient {
     RpcTestUtils.handlerBatchAppendTest(new ThrowingAvroHandler());
     logger.error("Throwing: I should never have gotten here!");
   }
-
-  @Test
-  public void spinThreadsCrazily() throws IOException {
-
-    int initThreadCount = ManagementFactory.getThreadMXBean().getThreadCount();
-
-    // find a port we know is closed by opening a free one then closing it
-    ServerSocket sock = new ServerSocket(0);
-    int port = sock.getLocalPort();
-    sock.close();
-
-    Properties props = new Properties();
-    props.put(RpcClientConfigurationConstants.CONFIG_CLIENT_TYPE,
-        RpcClientConfigurationConstants.DEFAULT_CLIENT_TYPE);
-    props.put(RpcClientConfigurationConstants.CONFIG_HOSTS, "h1");
-    props.put(RpcClientConfigurationConstants.CONFIG_HOSTS_PREFIX + "h1",
-        "localhost:" + port);
-    props.put(RpcClientConfigurationConstants.CONFIG_CONNECT_TIMEOUT, "20");
-    props.put(RpcClientConfigurationConstants.CONFIG_REQUEST_TIMEOUT, "20");
-    props.put(RpcClientConfigurationConstants.CONFIG_BATCH_SIZE, "1");
-
-    for (int i = 0; i < 1000; i++) {
-      RpcClient client = null;
-      try {
-        client = RpcClientFactory.getDefaultInstance("localhost", port);
-        client.append(EventBuilder.withBody("Hello", Charset.forName("UTF-8")));
-      } catch (FlumeException e) {
-        logger.warn("Unexpected error", e);
-      } catch (EventDeliveryException e) {
-        logger.warn("Expected error", e);
-      } finally {
-        if (client != null) {
-          client.close();
-        }
-      }
-    }
-
-    int threadCount = ManagementFactory.getThreadMXBean().getThreadCount();
-    logger.warn("Init thread count: {}, thread count: {}",
-        initThreadCount, threadCount);
-    Assert.assertEquals("Thread leak in RPC client",
-        initThreadCount, threadCount);
-
-  }
-
 }