HADOOP-15316. GenericTestUtils can exceed maxSleepTime. Contributed by Adam Antal.
This commit is contained in:
parent
b37074be5a
commit
4f3f9391b0
|
@ -661,7 +661,7 @@ public abstract class GenericTestUtils {
|
||||||
public Object answer(InvocationOnMock invocation) throws Throwable {
|
public Object answer(InvocationOnMock invocation) throws Throwable {
|
||||||
boolean interrupted = false;
|
boolean interrupted = false;
|
||||||
try {
|
try {
|
||||||
Thread.sleep(r.nextInt(maxSleepTime) + minSleepTime);
|
Thread.sleep(r.nextInt(maxSleepTime - minSleepTime) + minSleepTime);
|
||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
interrupted = true;
|
interrupted = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue