diff --git a/frontend/src/main/scala/bloop/engine/State.scala b/frontend/src/main/scala/bloop/engine/State.scala index 2ca0e1ecd..a5364e5de 100644 --- a/frontend/src/main/scala/bloop/engine/State.scala +++ b/frontend/src/main/scala/bloop/engine/State.scala @@ -67,7 +67,7 @@ object State { val opts = CommonOptions.default val cwd = opts.workingPath val clientInfo = ClientInfo.CliClientInfo(useStableCliDirs = true, () => true) - val results = ResultsCache.load(build, cwd, cleanOrphanedInternalDirs = false, logger) + val results = ResultsCache.load(build, cwd, cleanOrphanedInternalDirs = true, logger) State( build, results, diff --git a/frontend/src/test/scala/bloop/bsp/BspCompileSpec.scala b/frontend/src/test/scala/bloop/bsp/BspCompileSpec.scala index e2f36d760..4775c70f8 100644 --- a/frontend/src/test/scala/bloop/bsp/BspCompileSpec.scala +++ b/frontend/src/test/scala/bloop/bsp/BspCompileSpec.scala @@ -21,6 +21,7 @@ import bloop.util.TestProject import bloop.util.TestUtil import coursierapi.Fetch +import scala.util.control.NonFatal object TcpBspCompileSpec extends BspCompileSpec(BspProtocol.Tcp) object LocalBspCompileSpec extends BspCompileSpec(BspProtocol.Local) @@ -207,22 +208,28 @@ class BspCompileSpec( val _ = bspState.scalaOptions(`A`) } - // Wait until the extra directory is finally deleted at the end of the bsp session - TestUtil.await( - FiniteDuration(10, TimeUnit.SECONDS), - bloop.engine.ExecutionContext.ioScheduler - ) { - Task { - var check: Boolean = true - while (check) { - // The task cleaning up client classes directories should have removed the extra dir - check = orphanClientClassesDir.exists && orphanInternalClassesDir.exists - Thread.sleep(100) - } - }.timeoutTo( - FiniteDuration(5, TimeUnit.SECONDS), - Task(sys.error(s"Expected deletion of $orphanClientClassesDir")) - ) + try { + // Wait until the extra directory is finally deleted at the end of the bsp session + TestUtil.await( + FiniteDuration(10, TimeUnit.SECONDS), + bloop.engine.ExecutionContext.ioScheduler + ) { + Task { + var check: Boolean = true + while (check) { + // The task cleaning up client classes directories should have removed the extra dir + check = orphanClientClassesDir.exists && orphanInternalClassesDir.exists + Thread.sleep(100) + } + }.timeoutTo( + FiniteDuration(5, TimeUnit.SECONDS), + Task(sys.error(s"Expected deletion of $orphanClientClassesDir")) + ) + } + } catch { + case NonFatal(e) => + println(logger.render) + throw e } } }