提交 7ed26b96 编写于 作者: O okutsu

7035446: some regression tests take too long

Reviewed-by: peytoia
上级 72ad7203
/* /*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* that this test case fails without the fix in some different ways, * that this test case fails without the fix in some different ways,
* including timeout, due to the memory corruption. * including timeout, due to the memory corruption.
* @build Bug6665028 * @build Bug6665028
* @run main/othervm/timeout=60 -Xmx16m Bug6665028 * @run main/othervm -Xmx16m Bug6665028 10
*/ */
import java.awt.font.TextAttribute; import java.awt.font.TextAttribute;
...@@ -36,6 +36,7 @@ import java.text.AttributedString; ...@@ -36,6 +36,7 @@ import java.text.AttributedString;
import java.text.Bidi; import java.text.Bidi;
// test1() and test2() were derived from BidiEmbeddingTest. // test1() and test2() were derived from BidiEmbeddingTest.
// Usage: java Bug6665028 [duration]
public class Bug6665028 { public class Bug6665028 {
private static boolean runrun = true; private static boolean runrun = true;
...@@ -50,6 +51,11 @@ public class Bug6665028 { ...@@ -50,6 +51,11 @@ public class Bug6665028 {
} }
public static void main(String[] args) { public static void main(String[] args) {
int duration = 45;
if (args.length == 1) {
duration = Math.max(1, Math.min(Integer.parseInt(args[0]), 45));
}
Test[] tests = new Test[4]; Test[] tests = new Test[4];
for (int i = 0; i < tests.length; i++) { for (int i = 0; i < tests.length; i++) {
Test t = new Test(); Test t = new Test();
...@@ -58,7 +64,7 @@ public class Bug6665028 { ...@@ -58,7 +64,7 @@ public class Bug6665028 {
} }
try { try {
Thread.sleep(45000); Thread.sleep(duration * 1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
} }
......
/* /*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -24,17 +24,22 @@ ...@@ -24,17 +24,22 @@
* @test * @test
* @bug 4518797 * @bug 4518797
* @summary Make sure that hashCode() and read/writeObject() are thread-safe. * @summary Make sure that hashCode() and read/writeObject() are thread-safe.
* @run main/timeout=200 Bug4518797 * @run main Bug4518797 10
*/ */
import java.util.*; import java.util.*;
import java.io.*; import java.io.*;
// Usage: java Bug4518797 [duration]
public class Bug4518797 { public class Bug4518797 {
static volatile boolean runrun = true; static volatile boolean runrun = true;
static volatile String message = null; static volatile String message = null;
public static void main(String[] args) { public static void main(String[] args) {
int duration = 180;
if (args.length == 1) {
duration = Math.max(5, Integer.parseInt(args[0]));
}
final Locale loc = new Locale("ja", "US"); final Locale loc = new Locale("ja", "US");
final int hashcode = loc.hashCode(); final int hashcode = loc.hashCode();
...@@ -84,7 +89,7 @@ public class Bug4518797 { ...@@ -84,7 +89,7 @@ public class Bug4518797 {
t1.start(); t1.start();
t2.start(); t2.start();
try { try {
for (int i = 0; runrun && i < 180; i++) { for (int i = 0; runrun && i < duration; i++) {
Thread.sleep(1000); Thread.sleep(1000);
} }
runrun = false; runrun = false;
......
/* /*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -24,12 +24,13 @@ ...@@ -24,12 +24,13 @@
* @test * @test
* @bug 5102289 * @bug 5102289
* @summary Stress test for ResourceBundle.getBundle with ResourceBundle.Control. * @summary Stress test for ResourceBundle.getBundle with ResourceBundle.Control.
* @run main/timeout=300/othervm -esa StressTest * @run main/othervm -esa StressTest 2 15
*/ */
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.*; import java.util.concurrent.atomic.*;
// Usage: java StressTest [threadsFactor [duration]]
public class StressTest { public class StressTest {
static final Locale ROOT_LOCALE = new Locale(""); static final Locale ROOT_LOCALE = new Locale("");
static final Random rand = new Random(); static final Random rand = new Random();
...@@ -60,16 +61,16 @@ public class StressTest { ...@@ -60,16 +61,16 @@ public class StressTest {
static volatile boolean runrun = true; static volatile boolean runrun = true;
public static void main(String[] args) { public static void main(String[] args) {
int nThreads = 2; int threadsFactor = 2;
if (args.length > 0) { if (args.length > 0) {
nThreads = Math.max(Integer.parseInt(args[0]), 2); threadsFactor = Math.max(2, Integer.parseInt(args[0]));
} }
int nSeconds = 180; int duration = 180;
if (args.length > 1) { if (args.length > 1) {
nSeconds = Integer.parseInt(args[1]); duration = Math.max(5, Integer.parseInt(args[1]));
} }
Locale.setDefault(Locale.US); Locale.setDefault(Locale.US);
Thread[] tasks = new Thread[locales.length * nThreads]; Thread[] tasks = new Thread[locales.length * threadsFactor];
counters = new AtomicIntegerArray(tasks.length); counters = new AtomicIntegerArray(tasks.length);
for (int i = 0; i < tasks.length; i++) { for (int i = 0; i < tasks.length; i++) {
...@@ -84,8 +85,8 @@ public class StressTest { ...@@ -84,8 +85,8 @@ public class StressTest {
System.out.printf("%d processors, intervalForCounterCheck = %d [sec]%n", System.out.printf("%d processors, intervalForCounterCheck = %d [sec]%n",
nProcessors, intervalForCounterCheck); nProcessors, intervalForCounterCheck);
try { try {
for (int i = 0; runrun && i < nSeconds; i++) { for (int i = 0; runrun && i < duration; i++) {
Thread.sleep(1000); // 1 seconds Thread.sleep(1000); // 1 second
if ((i % intervalForCounterCheck) == 0) { if ((i % intervalForCounterCheck) == 0) {
checkCounters(); checkCounters();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册