HADOOP-9773. TestLightWeightCache should not set size limit to zero when testing it.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1507165 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Tsz-wo Sze 2013-07-26 00:55:24 +00:00
parent 8fa3ebd134
commit 42e8cbf92c
2 changed files with 7 additions and 3 deletions

View File

@ -644,6 +644,9 @@ Release 2.1.0-beta - 2013-07-02
HADOOP-9759. Add support for NativeCodeLoader#getLibraryName on Windows.
(Chuan Liu via cnauroth)
HADOOP-9773. TestLightWeightCache should not set size limit to zero when
testing it. (szetszwo)
BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS
HADOOP-8924. Hadoop Common creating package-info.java must not depend on

View File

@ -27,9 +27,10 @@
/** Testing {@link LightWeightCache} */
public class TestLightWeightCache {
private static final long starttime = Time.now();
private static final Random ran = new Random(starttime);
private static final long seed = starttime;
private static final Random ran = new Random(seed);
static {
println("Start time = " + new Date(starttime) + ", seed=" + starttime);
println("Start time = " + new Date(starttime) + ", seed=" + seed);
}
private static void print(Object s) {
@ -65,7 +66,7 @@ public void testLightWeightCache() {
final int dataSize = 1 << 16;
for(int i = 0; i < 10; i++) {
final int modulus = ran.nextInt(1024) + 1;
final int sizeLimit = ran.nextInt(modulus);
final int sizeLimit = ran.nextInt(modulus) + 1;
checkSizeLimit(sizeLimit, dataSize, modulus);
}
}