service/dap: avoid double removal of temp built binary (#2335)

* Avoid double removal of temp binary

* Add back accidentally removed empty line

* Simplify regex

* Use unique build output directories in test cases

* Recover TestLaunchDebugRequest hidden logging and refine error check

* Special case access-denied error on Windows

* Remove special case for access denied on Windows

* Increase remove delay on Win

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
This commit is contained in:
polinasok
2021-02-24 08:19:07 -08:00
committed by GitHub
parent 92fb175192
commit 2e80b32c41
4 changed files with 28 additions and 2 deletions

View File

@ -20,7 +20,7 @@ func Remove(path string) {
// Open files can be removed on Unix, but not on Windows, where there also appears
// to be a delay in releasing the binary when the process exits. So we try again.
if err != nil && runtime.GOOS == "windows" {
time.Sleep(10 * time.Microsecond)
time.Sleep(100 * time.Microsecond)
err = os.Remove(path)
}
if err != nil {