8159899: [TEST_BUG] Timeout in tests when OOM should be generated
authorserb
Tue, 26 Jul 2016 15:55:22 +0300
changeset 40149 3c1b3274aa52
parent 40148 f590f972ba1a
child 40150 b4177fc65b33
8159899: [TEST_BUG] Timeout in tests when OOM should be generated Reviewed-by: yan, ssadetsky
jdk/test/javax/swing/JOptionPane/6464022/bug6464022.java
jdk/test/javax/swing/UIDefaults/6795356/bug6795356.java
jdk/test/javax/swing/regtesthelpers/Util.java
jdk/test/sun/java2d/Disposer/TestDisposerLeak.java
--- a/jdk/test/javax/swing/JOptionPane/6464022/bug6464022.java	Tue Jul 26 14:54:26 2016 +0300
+++ b/jdk/test/javax/swing/JOptionPane/6464022/bug6464022.java	Tue Jul 26 15:55:22 2016 +0300
@@ -29,7 +29,7 @@
  * @author Pavel Porvatov
  * @library ../../regtesthelpers
  * @build Util
- * @run main bug6464022
+ * @run main/othervm -mx128m bug6464022
  */
 
 import javax.swing.*;
--- a/jdk/test/javax/swing/UIDefaults/6795356/bug6795356.java	Tue Jul 26 14:54:26 2016 +0300
+++ b/jdk/test/javax/swing/UIDefaults/6795356/bug6795356.java	Tue Jul 26 15:55:22 2016 +0300
@@ -28,7 +28,7 @@
  * @author Alexander Potochkin
  * @library ../../regtesthelpers
  * @build Util
- * @run main bug6795356
+ * @run main/othervm -mx128m bug6795356
  */
 
 import java.lang.ref.WeakReference;
--- a/jdk/test/javax/swing/regtesthelpers/Util.java	Tue Jul 26 14:54:26 2016 +0300
+++ b/jdk/test/javax/swing/regtesthelpers/Util.java	Tue Jul 26 15:55:22 2016 +0300
@@ -81,7 +81,8 @@
 
     /**
      * Fills the heap until OutOfMemoryError occurs. This method is useful for
-     * WeakReferences removing.
+     * WeakReferences removing. To minimize the amount of filled memory the
+     * test should provide reasonable heap size via -mx option.
      */
     public static void generateOOME() {
         List<Object> bigLeak = new LinkedList<Object>();
--- a/jdk/test/sun/java2d/Disposer/TestDisposerLeak.java	Tue Jul 26 14:54:26 2016 +0300
+++ b/jdk/test/sun/java2d/Disposer/TestDisposerLeak.java	Tue Jul 26 15:55:22 2016 +0300
@@ -31,7 +31,7 @@
  * @test
  * @bug 8129457
  * @summary Check Disposer disposes all objects without any memory leaks
- * @run main/othervm TestDisposerLeak
+ * @run main/othervm -mx128m TestDisposerLeak
  * @modules java.desktop/sun.java2d
  */
 public final class TestDisposerLeak {