• Ian Lance Taylor's avatar
    cmd/go: revert "cmd/go: no longer eval symlinks in inDir" · 0cab8bfd
    Ian Lance Taylor authored
    It breaks on the Darwin builders, with
    
    --- FAIL: TestTestCacheInputs (21.65s)
        go_test.go:5371: file.txt: old=2018-08-02 15:12:21.136438 -0700 PDT m=+219.458659208, info.ModTime=2018-08-02 15:12:21 -0700 PDT
        go_test.go:5377: running testgo [test testcache]
        go_test.go:5377: standard output:
        go_test.go:5377: ok  	testcache	0.013s
    
        go_test.go:5378: running testgo [test testcache]
        go_test.go:5378: standard output:
        go_test.go:5378: ok  	testcache	(cached)
    
        go_test.go:5382: running testgo [test testcache]
        go_test.go:5382: standard output:
        go_test.go:5382: ok  	testcache	0.172s
    
        go_test.go:5384: running testgo [test testcache]
        go_test.go:5384: standard output:
        go_test.go:5384: ok  	testcache	(cached)
    
        go_test.go:5387: running testgo [test testcache -run=FileSize]
        go_test.go:5387: standard output:
        go_test.go:5387: ok  	testcache	0.012s
    
        go_test.go:5388: running testgo [test testcache -run=FileSize]
        go_test.go:5388: standard output:
        go_test.go:5388: ok  	testcache	(cached)
    
        go_test.go:5391: running testgo [test testcache -run=FileSize]
        go_test.go:5391: standard output:
        go_test.go:5391: ok  	testcache	0.008s
    
        go_test.go:5393: running testgo [test testcache -run=FileSize]
        go_test.go:5393: standard output:
        go_test.go:5393: ok  	testcache	(cached)
    
        go_test.go:5396: running testgo [test testcache -run=Chdir]
        go_test.go:5396: standard output:
        go_test.go:5396: ok  	testcache	0.417s
    
        go_test.go:5397: running testgo [test testcache -run=Chdir]
        go_test.go:5397: standard output:
        go_test.go:5397: ok  	testcache	(cached)
    
        go_test.go:5400: running testgo [test testcache -run=Chdir]
        go_test.go:5400: standard output:
        go_test.go:5400: ok  	testcache	(cached)
    
        go_test.go:5401: did not notice file size change
        go_test.go:5401: pattern \(cached\) found unexpectedly in standard output
    FAIL
    
    Original CL description:
    
        Evaluating the symlinks was slowing down test cache checks.
    
        Fixes #26562
        Fixes #26726
    
                ijt:~/gopath/src/issue26562$ cat foo_test.go
                package foo_test
    
                import (
                        "fmt"
                        "os"
                        "path/filepath"
                        "testing"
                )
    
                // package and imports snipped
                func TestCache(t *testing.T) {
                        tmp := os.TempDir()
                        for i := 0; i < 1000000; i++ {
                                os.Stat(filepath.Join(tmp, fmt.Sprintf("%d", i)))
                        }
                }
                ijt:~/gopath/src/issue26562$ time ~/github/go/bin/go test -count=1
                PASS
                ok      issue26562      9.444s
    
                real    0m10.021s
                user    0m2.344s
                sys     0m7.835s
                ijt:~/gopath/src/issue26562$ time ~/github/go/bin/go test .
                ok      issue26562      (cached)
    
                real    0m0.802s
                user    0m0.551s
                sys     0m0.306s
    
    Updates #26562
    Updates #26726
    
    Change-Id: I7914ee57dc75bcbd7f0ea01c70bed97d67c810ea
    Reviewed-on: https://go-review.googlesource.com/127715
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    0cab8bfd
Name
Last commit
Last update
..
archive Loading commit data...
bufio Loading commit data...
builtin Loading commit data...
bytes Loading commit data...
cmd Loading commit data...
compress Loading commit data...
container Loading commit data...
context Loading commit data...
crypto Loading commit data...
database/sql Loading commit data...
debug Loading commit data...
encoding Loading commit data...
errors Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
hash Loading commit data...
html Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
internal Loading commit data...
io Loading commit data...
log Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
os Loading commit data...
path Loading commit data...
plugin Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
testing Loading commit data...
text Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
vendor/golang_org/x Loading commit data...
Make.dist Loading commit data...
all.bash Loading commit data...
all.bat Loading commit data...
all.rc Loading commit data...
androidtest.bash Loading commit data...
bootstrap.bash Loading commit data...
buildall.bash Loading commit data...
clean.bash Loading commit data...
clean.bat Loading commit data...
clean.rc Loading commit data...
cmp.bash Loading commit data...
iostest.bash Loading commit data...
make.bash Loading commit data...
make.bat Loading commit data...
make.rc Loading commit data...
naclmake.bash Loading commit data...
nacltest.bash Loading commit data...
race.bash Loading commit data...
race.bat Loading commit data...
run.bash Loading commit data...
run.bat Loading commit data...
run.rc Loading commit data...