Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/internal/lsp/regtest: test output is much too verbose #39130

Closed
bcmills opened this issue May 18, 2020 · 4 comments
Closed

x/tools/internal/lsp/regtest: test output is much too verbose #39130

bcmills opened this issue May 18, 2020 · 4 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented May 18, 2020

What version of Go are you using (go version)?

~/src/golang.org/x/tools$ go version
go version devel +810c27e9be Wed May 13 11:59:26 2020 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
~/src/golang.org/x/tools$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/usr/local/google/home/bcmills/.cache/go-build"
GOENV="/usr/local/google/home/bcmills/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/usr/local/google/home/bcmills/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/usr/local/google/home/bcmills"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/google/home/bcmills/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/google/home/bcmills/go/pkg/tool/linux_amd64"
GCCGO="/usr/local/google/home/bcmills/bin/gccgo"
GOAMD64="alignedjumps"
AR="ar"
CC="gcc"
CXX="c++"
CGO_ENABLED="1"
GOMOD="/usr/local/google/home/bcmills/src/golang.org/x/tools/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build713277181=/tmp/go-build -gno-record-gcc-switches"

What did you do?

~/src/golang.org/x/tools$ git fetch "https://go.googlesource.com/tools" refs/changes/12/234112/3 && git checkout FETCH_HEAD

~/src/golang.org/x/tools$ go test ./internal/lsp/regtest >regtest.txt

~/src/golang.org/x/tools$ du -h regtest.txt
108K    regtest.txt

What did you expect to see?

A comprehensible, human-readable report of test failures, along with a small amount of contextual information relevant to those failures.

What did you see instead?

108 KiB of unfiltered logs that appear to be mostly irrelevant to the actual test case that failed.

It appears that something within the test is piping all output of subprocesses directly to os.Stdout or os.Stderr, rather than saving the output to a buffer and using t.Logf or similar to associate the buffered logs with a specific test case.

CC @findleyr @stamblerre @ianthehat

@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels May 18, 2020
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels May 18, 2020
@gopherbot gopherbot added this to the Unreleased milestone May 18, 2020
@findleyr findleyr self-assigned this May 18, 2020
@findleyr
Copy link
Contributor

I agree, though some of this output was added to help diagnose hard-to-reproduce flakes:

  • gopls RPC logs
  • goroutine profile

I'll see if there's somewhere else I can write these artifacts.

@gopherbot
Copy link

Change https://golang.org/cl/235920 mentions this issue: internal/lsp/regtest: don't print RPC logs on test failure by default

@gopherbot
Copy link

Change https://golang.org/cl/237583 mentions this issue: internal/lsp/regtest: fix context for shared server

@gopherbot
Copy link

Change https://golang.org/cl/237582 mentions this issue: internal/jsonrpc2: try to suppress unnecessary errors on shutdown

gopherbot pushed a commit to golang/tools that referenced this issue Jun 11, 2020
Use the -v flag to control whether RPC logs are always printed, rather
than a regtest specific flag.

Updates golang/go#39130

Change-Id: Ie6293815adee4b59defd80cfc015838cfbf2b3e8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/235920
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Peter Weinberger <pjw@google.com>
gopherbot pushed a commit to golang/tools that referenced this issue Jun 11, 2020
Even on successful shutdown, test logs contain a lot of "failed reading
header line: EOF". This can be distracting, or worse, misleading. Do our
best to suppress these error logs.

Updates golang/go#39130

Change-Id: I6ebe61100501f69c7490b418f53871b4e9704a00
Reviewed-on: https://go-review.googlesource.com/c/tools/+/237582
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
@golang golang locked and limited conversation to collaborators Jun 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants