changeset 53990:8c82412da698

8219513: compiler/codegen/aes/TestCipherBlockChainingEncrypt.java timeout on Solaris-sparc Reviewed-by: kvn, iignatyev Contributed-by: fairoz.matte@oracle.com
author kevinw
date Fri, 01 Mar 2019 04:34:28 -0800
parents 247f1a85d736
children 786825220790
files test/hotspot/jtreg/compiler/codegen/aes/TestCipherBlockChainingEncrypt.java
diffstat 1 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/compiler/codegen/aes/TestCipherBlockChainingEncrypt.java	Fri Mar 01 14:38:59 2019 +0800
+++ b/test/hotspot/jtreg/compiler/codegen/aes/TestCipherBlockChainingEncrypt.java	Fri Mar 01 04:34:28 2019 -0800
@@ -25,7 +25,12 @@
  * @test
  * @bug 8209951
  * @summary SIGBUS in com.sun.crypto.provider.CipherBlockChaining
- * @run main/othervm/timeout=300 -Xbatch
+ * @library /test/lib /
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ *
+ * @run main/othervm -Xbatch
+ *     -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *      compiler.codegen.aes.TestCipherBlockChainingEncrypt
  */
 
@@ -40,6 +45,10 @@
 import javax.crypto.SecretKeyFactory;
 import javax.crypto.spec.PBEKeySpec;
 
+import compiler.whitebox.CompilerWhiteBoxTest;
+import sun.hotspot.code.Compiler;
+import jtreg.SkippedException;
+
 public class TestCipherBlockChainingEncrypt {
     private static String algorithm = "PBEWithHmacSHA1AndAES_256";
     private static final String PBEPASS = "Hush, it's supposed to be a secret!";
@@ -53,8 +62,11 @@
     private static Cipher ci;
 
     public static void main(String[] args) throws Exception {
-     for(int i=0; i<5_000; i++) {
-        if (!(new TestCipherBlockChainingEncrypt().test(args))) {
+        if (!Compiler.isIntrinsicAvailable(CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION, "com.sun.crypto.provider.CipherBlockChaining", "implEncrypt", byte[].class, int.class, int.class, byte[].class, int.class)) {
+            throw new SkippedException("Base64 intrinsic is not available");
+        }
+        for(int i=0; i<2_000; i++) {
+          if (!(new TestCipherBlockChainingEncrypt().test(args))) {
             throw new RuntimeException("TestCipherBlockChainingEncrypt test failed");
        }
      }