chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r825607 - in /hadoop/chukwa/trunk: CHANGES.txt src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestDirTailingAdaptor.java
Date Thu, 15 Oct 2009 18:34:04 GMT
Author: asrabkin
Date: Thu Oct 15 18:34:04 2009
New Revision: 825607

URL: http://svn.apache.org/viewvc?rev=825607&view=rev
Log:
CHUKWA-401. Fix race condition in Dir Tailing adaptor test case. (asrabkin)

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

Modified: hadoop/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/CHANGES.txt?rev=825607&r1=825606&r2=825607&view=diff
==============================================================================
--- hadoop/chukwa/trunk/CHANGES.txt (original)
+++ hadoop/chukwa/trunk/CHANGES.txt Thu Oct 15 18:34:04 2009
@@ -150,6 +150,8 @@
 
   BUG FIXES
 
+    CHUKWA-401. Fix race condition in Dir Tailing adaptor test case. (asrabkin)
+
     CHUKWA-398. Make ConstRateAdaptor more deterministic. (asrabkin)
 
     CHUKWA-386. Fix a bug in echo id to the browser for the iframe servlet. (Eric Yang)

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestDirTailingAdaptor.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestDirTailingAdaptor.java?rev=825607&r1=825606&r2=825607&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestDirTailingAdaptor.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/TestDirTailingAdaptor.java
Thu Oct 15 18:34:04 2009
@@ -29,6 +29,7 @@
 
   ChukwaAgent agent;
   File baseDir;
+  static final int SCAN_INTERVAL = 1000;
 
   public void testDirTailer() throws IOException,
   ChukwaAgent.AlreadyRunningException, InterruptedException {
@@ -38,6 +39,7 @@
     File checkpointDir = new File(baseDir, "dirtailerTestCheckpoints");
     createEmptyDir(checkpointDir);
     
+    conf.setInt("adaptor.dirscan.intervalMs", SCAN_INTERVAL);
     conf.set("chukwaAgent.checkpoint.dir", checkpointDir.getCanonicalPath());
     conf.set("chukwaAgent.checkpoint.name", "checkpoint_");
     conf.setInt("chukwaAgent.control.port", 0);
@@ -73,7 +75,8 @@
     anOldFile.setLastModified(10);//just after epoch
     agent = new ChukwaAgent(conf); //restart agent.
     
-
+    Thread.sleep(3 * SCAN_INTERVAL); //wait a bit for the new file to be detected.
+    
     //make sure we started tailing the new, not the old, file.
     for(Map.Entry<String, String> adaptors : agent.getAdaptorList().entrySet()) {
       System.out.println(adaptors.getKey() +": " + adaptors.getValue());



Mime
View raw message