chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r1515066 - in /incubator/chukwa/trunk: CHANGES.txt src/test/java/org/apache/hadoop/chukwa/datacollection/adaptor/TestExecAdaptor.java
Date Sun, 18 Aug 2013 03:58:33 GMT
Author: eyang
Date: Sun Aug 18 03:58:33 2013
New Revision: 1515066

URL: http://svn.apache.org/r1515066
Log:
CHUKWA-692. Fixed race condition of agent startup in TestExecAdaptor.  (Eric Yang)

Modified:
    incubator/chukwa/trunk/CHANGES.txt
    incubator/chukwa/trunk/src/test/java/org/apache/hadoop/chukwa/datacollection/adaptor/TestExecAdaptor.java

Modified: incubator/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/CHANGES.txt?rev=1515066&r1=1515065&r2=1515066&view=diff
==============================================================================
--- incubator/chukwa/trunk/CHANGES.txt (original)
+++ incubator/chukwa/trunk/CHANGES.txt Sun Aug 18 03:58:33 2013
@@ -34,6 +34,8 @@ Trunk (unreleased changes)
 
   BUGS
 
+    CHUKWA-692. Fixed race condition of agent startup in TestExecAdaptor.  (Eric Yang)
+
     CHUKWA-691. Improve pid file handling. (Eric Yang)
 
     CHUKWA-565. Added support HBaseWriter support for TsProcessor. (Bill Graham via Eric
Yang)

Modified: incubator/chukwa/trunk/src/test/java/org/apache/hadoop/chukwa/datacollection/adaptor/TestExecAdaptor.java
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/src/test/java/org/apache/hadoop/chukwa/datacollection/adaptor/TestExecAdaptor.java?rev=1515066&r1=1515065&r2=1515066&view=diff
==============================================================================
--- incubator/chukwa/trunk/src/test/java/org/apache/hadoop/chukwa/datacollection/adaptor/TestExecAdaptor.java
(original)
+++ incubator/chukwa/trunk/src/test/java/org/apache/hadoop/chukwa/datacollection/adaptor/TestExecAdaptor.java
Sun Aug 18 03:58:33 2013
@@ -28,13 +28,22 @@ import org.apache.hadoop.chukwa.datacoll
 public class TestExecAdaptor extends TestCase {
 
   Connector chunks;
+  private ChukwaAgent agent;
 
-
-  public void testWithPs() throws ChukwaAgent.AlreadyRunningException, InterruptedException
{
+  @Override
+  protected void setUp() throws ChukwaAgent.AlreadyRunningException, InterruptedException
{
     Configuration conf = new Configuration();
     conf.set("chukwaAgent.control.port", "0");
     conf.setBoolean("chukwaAgent.checkpoint.enabled", false);
-    ChukwaAgent agent = new ChukwaAgent(conf);
+    agent = new ChukwaAgent(conf);
+  }
+
+  @Override
+  protected void tearDown() {
+    this.agent.shutdown();
+  }
+
+  public void testWithPs() throws InterruptedException {
     ChunkCatcherConnector chunks = new ChunkCatcherConnector();
     chunks.start();
     String psAgentID = agent.processAddCommand(
@@ -42,7 +51,6 @@ public class TestExecAdaptor extends Tes
     Chunk c = chunks.waitForAChunk();
     System.out.println(new String(c.getData()));
     assertNotNull(psAgentID);
-    agent.shutdown();
   }
   
   /*
@@ -50,11 +58,6 @@ public class TestExecAdaptor extends Tes
    * Length of loop controlled by sleep statement near bottom of function
    */
   public void testForLeaks()  throws ChukwaAgent.AlreadyRunningException, InterruptedException
{
-    Configuration conf = new Configuration();
-    conf.set("chukwaAgent.control.port", "0");
-    conf.setBoolean("chukwaAgent.checkpoint.enabled", false);
-    ChukwaAgent agent = new ChukwaAgent(conf);
-
     chunks = new ConsoleOutConnector(agent, false);
     chunks.start();
     assertEquals(0, agent.adaptorCount());



Mime
View raw message