[FreezeLogger] do not report in tests

This commit is contained in:
Yaroslav Lepenkin
2016-08-15 11:53:13 +03:00
parent 3e22083c35
commit 8d2898299b
@@ -32,6 +32,11 @@ public class FreezeLogger {
private static final int MAX_ALLOWED_TIME = 500;
public static void runUnderPerformanceMonitor(@Nullable Project project, @NotNull Runnable action) {
if (ApplicationManager.getApplication().isUnitTestMode()) {
action.run();
return;
}
final ModalityState initial = ModalityState.current();
ALARM.cancelAllRequests();
ALARM.addRequest(() -> dumpThreads(project, initial), MAX_ALLOWED_TIME);