test/java/lang/invoke/MethodHandles/CatchExceptionTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
jdk Cdiff test/java/lang/invoke/MethodHandles/CatchExceptionTest.java
test/java/lang/invoke/MethodHandles/CatchExceptionTest.java
Print this page
rev 11029 : 8039953: [TESTBUG] Timeout java/lang/invoke/MethodHandles/CatchExceptionTest.java
Reviewed-by:
*** 22,40 ****
--- 22,43 ----
*/
package test.java.lang.invoke.MethodHandles;
import com.oracle.testlibrary.jsr292.Helper;
import jdk.testlibrary.Asserts;
+ import jdk.testlibrary.TimeLimitedRunner;
+ import jdk.testlibrary.Utils;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Array;
import java.util.*;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;
+ import java.util.concurrent.TimeUnit;
/* @test
* @library /lib/testlibrary/jsr292 /lib/testlibrary/
* @compile CatchExceptionTest.java
* @run main/othervm -esa test.java.lang.invoke.MethodHandles.CatchExceptionTest
*** 91,108 ****
catcher = testCase.getCatcher(getCatcherParams());
nargs = Math.max(2, this.argsCount);
}
public static void main(String[] args) throws Throwable {
! for (CatchExceptionTest test : TestFactory.MANDATORY_TEST_CASES) {
test.runTest();
}
! TestFactory factory = new TestFactory();
! CatchExceptionTest test;
! while ((test = factory.nextTest()) != null ) {
test.runTest();
}
}
private List<Class<?>> getThrowerParams(boolean isVararg, int argsCount) {
return Helper.getParams(ARGS_CLASSES, isVararg, argsCount);
}
--- 94,120 ----
catcher = testCase.getCatcher(getCatcherParams());
nargs = Math.max(2, this.argsCount);
}
public static void main(String[] args) throws Throwable {
! TestFactory factory = new TestFactory();
! long timeout = Helper.IS_THOROUGH ? 0L : Utils.adjustTimeout(Utils.DEFAULT_TEST_TIMEOUT);
! // substract vm init time and reserve time for vm exit
! timeout *= 0.9;
! TimeLimitedRunner runner = new TimeLimitedRunner(timeout,
! () -> {
! CatchExceptionTest test = factory.nextTest();
! if (test != null) {
test.runTest();
+ return true;
}
! return false;
! });
! for (CatchExceptionTest test : TestFactory.MANDATORY_TEST_CASES) {
test.runTest();
}
+ runner.call();
}
private List<Class<?>> getThrowerParams(boolean isVararg, int argsCount) {
return Helper.getParams(ARGS_CLASSES, isVararg, argsCount);
}
test/java/lang/invoke/MethodHandles/CatchExceptionTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File