Skip to content

Commit 45a4609

Browse files
committed
cmd/dist: skip moved GOROOT on Go's Windows builders when not sharding tests
Change-Id: I0bcae339624e7d61037d9ea0885b7bd07491bbb6 Reviewed-on: https://go-review.googlesource.com/51430 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent e157fac commit 45a4609

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/cmd/dist/test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,17 @@ func (t *tester) registerTests() {
447447
t.runPending(dt)
448448
moved := t.goroot + "-moved"
449449
if err := os.Rename(t.goroot, moved); err != nil {
450+
if t.goos == "windows" {
451+
// Fails on Windows (with "Access is denied") if a process
452+
// or binary is in this directory. For instance, using all.bat
453+
// when run from c:\workdir\go\src fails here
454+
// if GO_BUILDER_NAME is set. Our builders invoke tests
455+
// a different way which happens to work when sharding
456+
// tests, but we should be tolerant of the non-sharded
457+
// all.bat case.
458+
log.Printf("skipping test on Windows")
459+
return nil
460+
}
450461
return err
451462
}
452463

0 commit comments

Comments
 (0)