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

roachtest: fix stdout output #31405

Merged
merged 1 commit into from Oct 16, 2018

Conversation

Projects
None yet
4 participants
@andreimatei
Member

andreimatei commented Oct 15, 2018

roachtest's intention is that if there's no parallelism is requested,
logs are teed to stdout/stderr in addition to the test.log file. No
parallelism is specified explicitly by passing -p 1, or implicitly by
running a single test.
This patch fixes a bug where the "implicit" part was no longer behaving
as expected wrt the logs. The bug was introduced by a previous patch
that tried to reduce the scope of the "parallelism" global, but missed
the use in rootLogger(); the inferring of parallelism=1 was no longer
modifying the global. This patch kills the global for good.

Release note: None

@cockroach-teamcity

This comment has been minimized.

Show comment
Hide comment
@cockroach-teamcity

cockroach-teamcity Oct 15, 2018

Member

This change is Reviewable

Member

cockroach-teamcity commented Oct 15, 2018

This change is Reviewable

@petermattis

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


pkg/cmd/roachtest/test.go, line 872 at r1 (raw file):

					artifactsDir: t.ArtifactsDir(),
					localCluster: local,
					teeToStdout:  parallelism == 1,

Isn't parallelism still the global here? Even if this is somehow correct, I suggest getting rid of the global and tying the flag initialization to a local variable in main(). That will prevent accidental use of the global.

@benesch benesch removed their assignment Oct 16, 2018

@benesch

This comment has been minimized.

Show comment
Hide comment
@benesch

benesch Oct 16, 2018

Member

Deferring this review to @petermattis.

Member

benesch commented Oct 16, 2018

Deferring this review to @petermattis.

@andreimatei

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


pkg/cmd/roachtest/test.go, line 872 at r1 (raw file):

Previously, petermattis (Peter Mattis) wrote…

Isn't parallelism still the global here? Even if this is somehow correct, I suggest getting rid of the global and tying the flag initialization to a local variable in main(). That will prevent accidental use of the global.

yes, I had failed.
I've done what you said; good suggestion. I wanted to truly get rid of some of these globals, but I failed to read properly how we use Cobra and thus didn't see the obvious.

roachtest: fix stdout output
roachtest's intention is that if there's no parallelism is requested,
logs are teed to stdout/stderr in addition to the test.log file. No
parallelism is specified explicitly by passing -p 1, or implicitly by
running a single test.
This patch fixes a bug where the "implicit" part was no longer behaving
as expected wrt the logs. The bug was introduced by a previous patch
that tried to reduce the scope of the "parallelism" global, but missed
the use in rootLogger(); the inferring of parallelism=1 was no longer
modifying the global. This patch kills the global for good.

Release note: None
@petermattis

:lgtm:

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

@andreimatei

TFTR

bors r+

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

craig bot pushed a commit that referenced this pull request Oct 16, 2018

Merge #31405
31405: roachtest: fix stdout output r=andreimatei a=andreimatei

roachtest's intention is that if there's no parallelism is requested,
logs are teed to stdout/stderr in addition to the test.log file. No
parallelism is specified explicitly by passing -p 1, or implicitly by
running a single test.
This patch fixes a bug where the "implicit" part was no longer behaving
as expected wrt the logs. The bug was introduced by a previous patch
that tried to reduce the scope of the "parallelism" global, but missed
the use in rootLogger(); the inferring of parallelism=1 was no longer
modifying the global. This patch kills the global for good.

Release note: None

Co-authored-by: Andrei Matei <andrei@cockroachlabs.com>
@craig

This comment has been minimized.

Show comment
Hide comment
@craig

craig bot commented Oct 16, 2018

Build succeeded

@craig craig bot merged commit 0261e22 into cockroachdb:master Oct 16, 2018

3 checks passed

GitHub CI (Cockroach) TeamCity build finished
Details
bors Build succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@andreimatei andreimatei deleted the andreimatei:roachtest-fix-logging branch Oct 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment