8255011: [TESTBUG] compiler/codecache/stress/UnexpectedDeoptimizationAllTest.java timed out

Change CodeCacheStressRunner to have a 60 second test time

Reviewed-by: iignatyev
This commit is contained in:
Nils Eliasson 2020-11-10 11:25:53 +00:00
parent c601849e00
commit e281b13597
2 changed files with 10 additions and 4 deletions

View File

@ -28,6 +28,7 @@ import jdk.test.lib.Utils;
public class CodeCacheStressRunner {
private final Runnable action;
public CodeCacheStressRunner(Runnable action) {
this.action = action;
}
@ -35,10 +36,8 @@ public class CodeCacheStressRunner {
protected final void runTest() {
Helper.startInfiniteLoopThread(action);
try {
// adjust timeout and substract vm init and exit time
long timeout = Utils.adjustTimeout(Utils.DEFAULT_TEST_TIMEOUT);
timeout *= 0.8;
new TimeLimitedRunner(timeout, 2.0d, this::test).call();
// Adjust timeout and substract vm init and exit time
new TimeLimitedRunner(60 * 1000, 2.0d, this::test).call();
} catch (Exception e) {
throw new Error("Exception occurred during test execution", e);
}

View File

@ -60,6 +60,13 @@ public class UnexpectedDeoptimizationTest implements Runnable {
@Override
public void run() {
Helper.WHITE_BOX.deoptimizeFrames(rng.nextBoolean());
// Sleep a short while to allow the stacks to grow - otherwise
// we end up running almost all code in the interpreter
try {
Thread.sleep(10);
} catch (Exception e) {
}
}
}