Skip to content

Commit

Permalink
[starter gi] Some files in checkout dir might be blocked by other pro…
Browse files Browse the repository at this point in the history
…cess / already deleted

GitOrigin-RevId: f318326544f704f79cc6ae71c3d4d64d1ac3812a
  • Loading branch information
Nikita-Kudrin authored and intellij-monorepo-bot committed Feb 7, 2025
1 parent 2ae18fe commit 5818f18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import com.intellij.ide.starter.di.di
import com.intellij.ide.starter.ide.IDETestContext
import com.intellij.ide.starter.path.GlobalPaths
import com.intellij.ide.starter.utils.Git
import com.intellij.openapi.diagnostic.getOrLogException
import com.intellij.tools.ide.util.common.logError
import com.intellij.tools.ide.util.common.withRetryBlocking
import org.kodein.di.instance
import java.nio.file.Path
import kotlin.io.path.*
Expand Down Expand Up @@ -129,7 +129,7 @@ data class GitProjectInfo(
appendLine("Trying one more time from clean checkout")
}, ex)

runCatching { repositoryRootDir.deleteRecursively() }.getOrLogException { logError("Failed to delete $repositoryRootDir", it) }
withRetryBlocking("Failed to delete $repositoryRootDir", retries = 5) { repositoryRootDir.deleteRecursively() }

cloneRepo(repositoryRootDir)
setupRepositoryState(repositoryRootDir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import com.intellij.ide.starter.process.exec.ExecOutputRedirect
import com.intellij.ide.starter.process.exec.ProcessExecutor
import com.intellij.ide.starter.runner.SetupException
import com.intellij.openapi.application.PathManager
import com.intellij.openapi.diagnostic.getOrLogException
import com.intellij.tools.ide.util.common.logError
import com.intellij.tools.ide.util.common.logOutput
import com.intellij.tools.ide.util.common.withRetry
import java.io.File
import java.io.IOException
import java.nio.file.Path
Expand Down Expand Up @@ -106,7 +106,8 @@ object Git {

withRetryBlocking("Git clone $repoUrl failed", rollback = {
logOutput("Deleting $destinationDir ...")
runCatching { destinationDir.deleteRecursively() }.getOrLogException { logError("Failed to delete $destinationDir", it) }

withRetry("Failed to delete $destinationDir") { destinationDir.deleteRecursively() }
}) {
ProcessExecutor(
presentableName = cmdName,
Expand Down

0 comments on commit 5818f18

Please sign in to comment.