chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r937860 - /hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/writer/TestSocketTee.java
Date Sun, 25 Apr 2010 19:15:44 GMT
Author: eyang
Date: Sun Apr 25 19:15:43 2010
New Revision: 937860

URL: http://svn.apache.org/viewvc?rev=937860&view=rev
Log:
CHUKWA-478. Fixed TestSocketTee intermittent failure.  (Chris Douglas via Eric Yang)

Modified:
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/writer/TestSocketTee.java

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/writer/TestSocketTee.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/writer/TestSocketTee.java?rev=937860&r1=937859&r2=937860&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/writer/TestSocketTee.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/datacollection/writer/TestSocketTee.java
Sun Apr 25 19:15:43 2010
@@ -23,6 +23,7 @@ import org.apache.hadoop.chukwa.ChunkImp
 import org.apache.hadoop.chukwa.Chunk;
 import java.util.ArrayList;
 import org.apache.hadoop.chukwa.datacollection.collector.CaptureWriter;
+import org.apache.hadoop.io.IOUtils;
 import java.net.*;
 import java.io.*;
 
@@ -122,10 +123,10 @@ public class TestSocketTee  extends Test
     assertEquals(6, CaptureWriter.outputs.size());
     len = dis.readInt();
     data = new byte[len];
-    read = dis.read(data);
+    IOUtils.readFully(dis, data, 0, len);
     String rcvd = new String(data);
     System.out.println("got " + read+"/" +len  +" bytes: " + rcvd);
-    assertTrue("hostNameFoo dataTypeFoo streamName 4\ntext".equals(rcvd));
+    assertEquals("hostNameFoo dataTypeFoo streamName 4\ntext", rcvd);
     s3.close();
     dis.close();
     



Mime
View raw message