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

View File

@ -60,6 +60,13 @@ public class UnexpectedDeoptimizationTest implements Runnable {
@Override @Override
public void run() { public void run() {
Helper.WHITE_BOX.deoptimizeFrames(rng.nextBoolean()); 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) {
}
} }
} }