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

Comments

@Minnozz
Copy link

@Minnozz 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

This comment has been minimized.

Copy link
Member

@katiehockman katiehockman commented Sep 27, 2018

/cc @mpvl

@Minnozz

This comment has been minimized.

Copy link
Author

@Minnozz Minnozz commented Oct 5, 2018

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

@EnchanterIO

This comment has been minimized.

Copy link

@EnchanterIO 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

This comment has been minimized.

Copy link

@EnchanterIO EnchanterIO commented Feb 6, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.