diff --git a/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilMatchingTest.groovy b/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilMatchingTest.groovy index 24c86e4b66b7..21561dc65722 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilMatchingTest.groovy +++ b/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilMatchingTest.groovy @@ -25,6 +25,7 @@ import com.intellij.ui.SpeedSearchComparator import com.intellij.util.ThrowableRunnable import com.intellij.util.containers.ContainerUtil import com.intellij.util.text.Matcher +import junit.framework.AssertionFailedError import org.jetbrains.annotations.NonNls /** * @author max @@ -613,22 +614,31 @@ public class NameUtilMatchingTest extends UsefulTestCase { } System.out.println("measuring start: " + System.currentTimeMillis()); - PlatformTestUtil.startPerformanceTest("Matcher is slow", 4500, new ThrowableRunnable() { - @Override - public void run() { - System.out.println("attempt start: " + System.currentTimeMillis()); - for (int i = 0; i < 100000; i++) { - for (MinusculeMatcher matcher : matching) { - assertTrue(matcher.toString(), matcher.matches(longName)); - matcher.matchingDegree(longName); - } - for (MinusculeMatcher matcher : nonMatching) { - assertFalse(matcher.toString(), matcher.matches(longName)); + try { + PlatformTestUtil.startPerformanceTest("Matcher is slow", 4500, new ThrowableRunnable() { + @Override + public void run() { + System.out.println("attempt start: " + System.currentTimeMillis()); + for (int i = 0; i < 100000; i++) { + for (MinusculeMatcher matcher : matching) { + assertTrue(matcher.toString(), matcher.matches(longName)); + matcher.matchingDegree(longName); + } + for (MinusculeMatcher matcher : nonMatching) { + assertFalse(matcher.toString(), matcher.matches(longName)); + } } + System.out.println("attempt end: " + System.currentTimeMillis()); } - System.out.println("attempt end: " + System.currentTimeMillis()); - } - }).cpuBound().assertTiming(); + }).cpuBound().assertTiming() + } + catch (AssertionFailedError e) { + println "free " + Runtime.runtime.freeMemory() + println "total " + Runtime.runtime.totalMemory() + println "max " + Runtime.runtime.maxMemory() + printThreadDump(); + throw e + } } public void testOnlyUnderscoresPerformance() {