test is slow on slow machine

This commit is contained in:
Alexey Kudravtsev
2011-05-16 15:13:45 +04:00
parent 122bb27cc3
commit 2007b35f99
3 changed files with 9 additions and 9 deletions
@@ -55,7 +55,7 @@ public class IdeaTestUtil extends PlatformTestUtil {
@SuppressWarnings({"UseOfSystemOutOrSystemErr"})
public static void printDetectedPerformanceTimings() {
System.out.println("Etalon timing: " + ETALON_TIMING);
System.out.println("Etalon timing: " + Timings.ETALON_TIMING);
System.out.println("This machine timing: " + Timings.MACHINE_TIMING);
}
@@ -72,10 +72,6 @@ import java.util.jar.JarFile;
* @author yole
*/
public class PlatformTestUtil {
/**
* Measured on dual core p4 3HZ 1gig ram
*/
protected static final long ETALON_TIMING = 438;
public static final boolean COVERAGE_ENABLED_BUILD = "true".equals(System.getProperty("idea.coverage.enabled.build"));
public static final CvsVirtualFileFilter CVS_FILE_FILTER = new CvsVirtualFileFilter();
@@ -375,7 +371,7 @@ public class PlatformTestUtil {
public static void assertTiming(final String message, final long expected, final long actual) {
if (COVERAGE_ENABLED_BUILD) return;
final long expectedOnMyMachine = Math.max(1, expected * Timings.MACHINE_TIMING / ETALON_TIMING);
final long expectedOnMyMachine = Math.max(1, expected * Timings.MACHINE_TIMING / Timings.ETALON_TIMING);
final double acceptableChangeFactor = 1.1;
// Allow 10% more in case of test machine is busy.
@@ -387,7 +383,7 @@ public class PlatformTestUtil {
logMessage += " Expected on my machine: " + expectedOnMyMachine + "." +
" Actual: " + actual + "." +
" Expected on Etalon machine: " + expected + ";" +
" Actual on Etalon: " + actual * ETALON_TIMING / Timings.MACHINE_TIMING + ";" +
" Actual on Etalon: " + actual * Timings.ETALON_TIMING / Timings.MACHINE_TIMING + ";" +
" Timings: CPU=" + Timings.CPU_TIMING + ", I/O=" + Timings.IO_TIMING + ".";
if (actual < expectedOnMyMachine) {
@@ -33,9 +33,8 @@ public class Timings {
public static final long MACHINE_TIMING;
static {
long start;
start = System.currentTimeMillis();
long start = System.currentTimeMillis();
BigInteger k = new BigInteger("1");
for (int i = 0; i < CPU_PROBES; i++) {
k = k.add(new BigInteger("1"));
@@ -88,4 +87,9 @@ public class Timings {
MACHINE_TIMING = CPU_TIMING + IO_TIMING;
}
/**
* Measured on dual core p4 3HZ 1gig ram
*/
public static final long ETALON_TIMING = 438;
}