HBASE-10180 TestByteBufferIOEngine#testByteBufferIOEngine occasionally fails

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1551497 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
zjushch 2013-12-17 10:11:53 +00:00
parent fec8ee413b
commit 215899873f
1 changed files with 3 additions and 0 deletions

View File

@ -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;