mirror of https://github.com/golang/go.git
gopls/internal/regtest: allow cleanup to fail on windows
Due to Windows' default file locking and the fact that regtests shell out to the go command, cleanup sometimes fails. This is causing trybot flakes, increasingly as of late. Since the tempdir will eventually be cleaned up on the trybots anyway, don't fail on windows. For golang/go#38490 Change-Id: I136d97143baba1d98777db51daa062cf0e42e33e Reviewed-on: https://go-review.googlesource.com/c/tools/+/258315 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
parent
a44386fadb
commit
a6f32d173b
|
|
@ -10,6 +10,7 @@ import (
|
|||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
|
@ -78,11 +79,11 @@ func TestMain(m *testing.M) {
|
|||
code := m.Run()
|
||||
if err := runner.Close(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "closing test runner: %v\n", err)
|
||||
// Regtest cleanup is broken in go1.12 and earlier, but this is OK
|
||||
// for our CI.
|
||||
// Regtest cleanup is broken in go1.12 and earlier, and sometimes flakes on
|
||||
// Windows due to file locking, but this is OK for our CI.
|
||||
//
|
||||
// But fail on go1.13+.
|
||||
if testenv.Go1Point() >= 13 {
|
||||
// Fail on non-windows go1.13+.
|
||||
if testenv.Go1Point() >= 13 && runtime.GOOS != "windows" {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue