You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zj...@apache.org on 2013/12/17 11:11:53 UTC

svn commit: r1551497 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestByteBufferIOEngine.java

Author: zjushch
Date: Tue Dec 17 10:11:53 2013
New Revision: 1551497

URL: http://svn.apache.org/r1551497
Log:
HBASE-10180 TestByteBufferIOEngine#testByteBufferIOEngine occasionally fails

Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestByteBufferIOEngine.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestByteBufferIOEngine.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestByteBufferIOEngine.java?rev=1551497&r1=1551496&r2=1551497&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestByteBufferIOEngine.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestByteBufferIOEngine.java Tue Dec 17 10:11:53 2013
@@ -43,6 +43,9 @@ public class TestByteBufferIOEngine {
     for (int i = 0; i < testNum; i++) {
       byte val = (byte) (Math.random() * 255);
       int blockSize = (int) (Math.random() * maxBlockSize);
+      if (blockSize == 0) {
+        blockSize = 1;
+      }
       byte[] byteArray = new byte[blockSize];
       for (int j = 0; j < byteArray.length; ++j) {
         byteArray[j] = val;