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

testing: No way to view untruncated output from benchmarks #27901

Open
Minnozz opened this issue Sep 27, 2018 · 4 comments
Open

testing: No way to view untruncated output from benchmarks #27901

Minnozz opened this issue Sep 27, 2018 · 4 comments
Labels
NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@Minnozz
Copy link

Minnozz commented Sep 27, 2018

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

go version go1.10.3 linux/amd64

Does this issue reproduce with the latest release?

Unknown, but the documentation has not changed.

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/barts/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/barts/go"
GORACE=""
GOROOT="/usr/lib/go-1.10"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.10/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
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-build014311929=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I'm running a benchmark with the verbose flag turned on (go test -bench . -v) that calls b.Logf() multiple times.

What did you expect to see?

All logging output, like with tests.

What did you see instead?

The first few log calls, followed by ... [output truncated])

@katiehockman katiehockman added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 27, 2018
@katiehockman
Copy link
Contributor

/cc @mpvl

@Minnozz
Copy link
Author

Minnozz commented Oct 5, 2018

Truncating happens in testing.B.trimOutput(), called by testing.RunBenchmarks().

@EnchanterIO
Copy link

EnchanterIO commented Feb 6, 2020

@Minnozz did you find out how to avoid truncating? Not sure how this behavior can be useful because if I log something in my benchmark... it's to read it when the benchmark finishes.

I guess this is done for performance reasons? Maybe if it would get done async it wouldn't be a problem? But I would say definitely optional.

@EnchanterIO
Copy link

Checking more the benchmark code, the maxNewLines could be 10 by default but configurable not hardcoded.

Screen Shot 2020-02-06 at 12 56 43

@ALTree ALTree added NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jul 22, 2020
@ALTree ALTree added this to the Unplanned milestone Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

4 participants