mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't spawn gazillions of threads in tests
This commit is contained in:
+1
-1
@@ -598,7 +598,7 @@ public class LaterInvocatorTest extends PlatformTestCase {
|
||||
public void testDispatchInvocationEventsVsInvokeLaterFromBgThreadRace() {
|
||||
Application app = ApplicationManager.getApplication();
|
||||
app.invokeAndWait(() -> {
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
AtomicBoolean executed = new AtomicBoolean();
|
||||
app.executeOnPooledThread(() -> app.invokeLater(EmptyRunnable.INSTANCE));
|
||||
app.invokeLater(() -> executed.set(true));
|
||||
|
||||
+2
-2
@@ -663,8 +663,8 @@ public class FileDocumentManagerImplTest extends PlatformTestCase {
|
||||
List<Future> futures = new ArrayList<>();
|
||||
for (VirtualFile file : files) {
|
||||
assertNull(fdm.getCachedDocument(file));
|
||||
for (int i = 0; i < 30; i++) {
|
||||
futures.add(ApplicationManager.getApplication().executeOnPooledThread((Runnable)() -> ReadAction.run(() -> {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
futures.add(ApplicationManager.getApplication().executeOnPooledThread(() -> ReadAction.run(() -> {
|
||||
Document document = fdm.getDocument(file);
|
||||
assertEquals(file, fdm.getFile(document));
|
||||
})));
|
||||
|
||||
@@ -63,7 +63,7 @@ class CachedValuesTest extends LightPlatformTestCase {
|
||||
calcCount.set(0)
|
||||
dependency.incModificationCount()
|
||||
|
||||
List<Future> jobs = (0..<10).collect {
|
||||
List<Future> jobs = (0..<4).collect {
|
||||
ApplicationManager.application.executeOnPooledThread {
|
||||
for (i in 0..10) {
|
||||
assert 'result' == getCached()
|
||||
|
||||
@@ -100,7 +100,7 @@ public class DomIncludesTest extends LightCodeInsightFixtureTestCase {
|
||||
final PsiFile fileD = createFile("d.xml", textD);
|
||||
final String textE = "<xxx><boy/><child/><boy/><child/><boy/><child/><boy/><child/><boy/><child/><boy/><child/></xxx>";
|
||||
final PsiFile fileE = createFile("e.xml", textE);
|
||||
final int threadCount = 100;
|
||||
final int threadCount = 20;
|
||||
final int iterationCount = Timings.adjustAccordingToMySpeed(100, true);
|
||||
System.out.println("iterationCount = " + iterationCount);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user