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

opt: suppress logs in benchmarks #58974

Merged
merged 1 commit into from
Jan 19, 2021

Conversation

mgartner
Copy link
Collaborator

As of #57134 passing -logtostderr=false as a TESTFLAG in benchmarks
errs: flag provided but not defined: -logtostderr. The preferred
method for suppressing logs in tests and benchmarks to is add
defer log.Scope(t).Close(t) to the top of the test/benchmark
(see #57979).

This commit uses this new method to suppress logs in optimizer
benchmarks.

Release note: None

@mgartner mgartner requested a review from a team as a code owner January 13, 2021 21:42
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@mgartner mgartner force-pushed the suppress-logs-in-opt-benchmarks branch from 2157c56 to f6cc69b Compare January 13, 2021 23:03
Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 3 files at r1, 1 of 1 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @mgartner and @RaduBerinde)


pkg/sql/opt/bench/bench_test.go, line 281 at r2 (raw file):

	skip.IgnoreLint(t,
		"Remove this when profiling. Use profile flags above to configure. Sample command line: \n"+
			"GOMAXPROCS=1 go test -run TestCPUProfile --logtostderr NONE && go tool pprof bench.test cpu.out",

Just curious, why did you need to get rid of the bench.test param?

As of cockroachdb#57134 passing `-logtostderr=false` as a `TESTFLAG` in benchmarks
errs: `flag provided but not defined: -logtostderr`. The preferred
method for suppressing logs in tests and benchmarks to is add
`defer log.Scope(t).Close(t)` to the top of the test/benchmark
(see cockroachdb#57979).

This commit uses this new method to suppress logs in optimizer
benchmarks.

Release note: None
@mgartner mgartner force-pushed the suppress-logs-in-opt-benchmarks branch from f6cc69b to a628983 Compare January 16, 2021 01:35
Copy link
Collaborator Author

@mgartner mgartner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @RaduBerinde and @rytaft)


pkg/sql/opt/bench/bench_test.go, line 281 at r2 (raw file):

Previously, rytaft (Rebecca Taft) wrote…

Just curious, why did you need to get rid of the bench.test param?

It's treated by go tool pprof as a file, and that file is not generated by the go test command, only cpu.out is. So go tool pprof errors with: bench.test: open bench.test: no such file or directory. I'm not sure why it was included in this comment in the first place.

Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r3.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @RaduBerinde)


pkg/sql/opt/bench/bench_test.go, line 281 at r2 (raw file):

Previously, mgartner (Marcus Gartner) wrote…

It's treated by go tool pprof as a file, and that file is not generated by the go test command, only cpu.out is. So go tool pprof errors with: bench.test: open bench.test: no such file or directory. I'm not sure why it was included in this comment in the first place.

got it - thanks!

@mgartner
Copy link
Collaborator Author

bors r=rytaft

@craig
Copy link
Contributor

craig bot commented Jan 19, 2021

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jan 19, 2021

Build succeeded:

@craig craig bot merged commit debeb0b into cockroachdb:master Jan 19, 2021
@mgartner mgartner deleted the suppress-logs-in-opt-benchmarks branch January 19, 2021 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants