14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import jdk.test.lib.*;
25 import jdk.test.lib.process.*;
26
27 /*
28 * @test TestAbortOnVMOperationTimeout
29 * @bug 8181143
30 * @summary Check abort on VM timeout is working
31 * @library /test/lib
32 * @modules java.base/jdk.internal.misc
33 * java.management
34 */
35
36 public class TestAbortOnVMOperationTimeout {
37
38 public static void main(String[] args) throws Exception {
39 if (args.length > 0) {
40 Object[] arr = new Object[10_000_000];
41 for (int i = 0; i < arr.length; i++) {
42 arr[i] = new Object();
43 }
44 return;
45 }
46
47 // These should definitely pass: more than a minute is enough for Serial to act.
48 // The values are deliberately non-round to trip off periodic task granularity.
49 for (int delay : new int[]{63423, 12388131}) {
50 testWith(delay, true);
51 }
52
53 // These should fail: Serial is not very fast. Traversing 10M objects in 5 ms
|
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import jdk.test.lib.*;
25 import jdk.test.lib.process.*;
26
27 /*
28 * @test TestAbortOnVMOperationTimeout
29 * @bug 8181143
30 * @summary Check abort on VM timeout is working
31 * @library /test/lib
32 * @modules java.base/jdk.internal.misc
33 * java.management
34 * @run driver TestAbortOnVMOperationTimeout
35 */
36
37 public class TestAbortOnVMOperationTimeout {
38
39 public static void main(String[] args) throws Exception {
40 if (args.length > 0) {
41 Object[] arr = new Object[10_000_000];
42 for (int i = 0; i < arr.length; i++) {
43 arr[i] = new Object();
44 }
45 return;
46 }
47
48 // These should definitely pass: more than a minute is enough for Serial to act.
49 // The values are deliberately non-round to trip off periodic task granularity.
50 for (int delay : new int[]{63423, 12388131}) {
51 testWith(delay, true);
52 }
53
54 // These should fail: Serial is not very fast. Traversing 10M objects in 5 ms
|