set stress flag as early as possible before e.g. VirtualFileManagerImpl init which checks the flag to add all sorts of slow debug logging

This commit is contained in:
Alexey Kudravtsev
2017-06-08 18:27:35 +03:00
parent f003e6043d
commit d0930c097f

View File

@@ -16,9 +16,12 @@
package com.intellij.testFramework.fixtures;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
import com.intellij.openapi.util.Disposer;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.testFramework.SkipInHeadlessEnvironment;
import com.intellij.testFramework.SkipSlowTestLocally;
import com.intellij.testFramework.UsefulTestCase;
import org.jetbrains.annotations.NotNull;
import org.junit.After;
import org.junit.Before;
@@ -36,6 +39,8 @@ public abstract class BareTestFixtureTestCase {
@Before
public final void setupFixture() throws Exception {
ApplicationInfoImpl.setInStressTest(UsefulTestCase.isPerformanceTest(null, getClass().getName()));
boolean headless = SKIP_HEADLESS && getClass().getAnnotation(SkipInHeadlessEnvironment.class) != null;
assumeFalse("Class '" + getClass().getName() + "' is skipped because it requires working UI environment", headless);
boolean slow = SKIP_SLOW && getClass().getAnnotation(SkipSlowTestLocally.class) != null;
@@ -43,6 +48,7 @@ public abstract class BareTestFixtureTestCase {
myFixture = IdeaTestFixtureFactory.getFixtureFactory().createBareFixture();
myFixture.setUp();
Disposer.register(getTestRootDisposable(), ()-> ApplicationInfoImpl.setInStressTest(false));
}
@After