mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
in test mode make sure the command queue is drained before service disposal (IDEA-340414)
GitOrigin-RevId: 52f85bce04eef57e742cbdf38de41e6e1219479c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
102cab878d
commit
bc423766d1
@@ -117,7 +117,8 @@ import org.jetbrains.jps.model.java.compiler.JavaCompilers;
|
||||
import org.jvnet.winp.Priority;
|
||||
import org.jvnet.winp.WinProcess;
|
||||
|
||||
import javax.tools.*;
|
||||
import javax.tools.JavaCompiler;
|
||||
import javax.tools.ToolProvider;
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -1128,6 +1129,17 @@ public final class BuildManager implements Disposable {
|
||||
public void dispose() {
|
||||
stopListening();
|
||||
myAutomakeTrigger.cancel();
|
||||
if (IS_UNIT_TEST_MODE) {
|
||||
// wait until command queue with already submitted tasks is drained
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
runCommand(() -> latch.countDown());
|
||||
try {
|
||||
latch.await();
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
LOG.info(e);
|
||||
}
|
||||
}
|
||||
myRequestsProcessor.cancel();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user