mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't sleep for nothing when preloading actions in ProjectLeakTest
This commit is contained in:
+13
-13
@@ -1273,12 +1273,7 @@ public final class ActionManagerImpl extends ActionManagerEx implements Disposab
|
||||
}
|
||||
|
||||
private void doPreloadActions() {
|
||||
try {
|
||||
Thread.sleep(5000); // wait for project initialization to complete
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
return; // IDEA exited
|
||||
}
|
||||
pausePreloading(5000); // wait for project initialization to complete
|
||||
preloadActionGroup(IdeActions.GROUP_EDITOR_POPUP);
|
||||
preloadActionGroup(IdeActions.GROUP_EDITOR_TAB_POPUP);
|
||||
preloadActionGroup(IdeActions.GROUP_PROJECT_VIEW_POPUP);
|
||||
@@ -1317,17 +1312,22 @@ public final class ActionManagerImpl extends ActionManagerEx implements Disposab
|
||||
|
||||
myActionsPreloaded++;
|
||||
if (myActionsPreloaded % 10 == 0) {
|
||||
try {
|
||||
//noinspection BusyWait
|
||||
Thread.sleep(300);
|
||||
}
|
||||
catch (InterruptedException ignored) {
|
||||
throw new RuntimeInterruptedException(ignored);
|
||||
}
|
||||
pausePreloading(300);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void pausePreloading(int millis) {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) return;
|
||||
|
||||
try {
|
||||
Thread.sleep(millis);
|
||||
}
|
||||
catch (InterruptedException ignored) {
|
||||
throw new RuntimeInterruptedException(ignored);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionCallback tryToExecute(@NotNull final AnAction action, @NotNull final InputEvent inputEvent, @Nullable final Component contextComponent, @Nullable final String place,
|
||||
boolean now) {
|
||||
|
||||
Reference in New Issue
Block a user