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

logic: keep cockroach-go logs in case of failure #104876

Merged

Conversation

renatolabs
Copy link
Collaborator

This commit makes use of the new CockroachLogsDirOpt option introduced in [1] to pass a custom directory where cockroach logs will be stored. This directory is relative to TMPDIR, which is part of the artifacts path when the test runs in CI. With this change, when a logic test using the cockroach-go config fails, we'll be able to see both the test logs as well as the cockroach logs themselves. The latter will be in the cockroach.stderr file.

[1] cockroachdb/cockroach-go#170

Epic: none

Release note: None

@renatolabs renatolabs requested a review from a team June 14, 2023 14:06
@renatolabs renatolabs requested a review from a team as a code owner June 14, 2023 14:06
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@renatolabs renatolabs force-pushed the rc/save-cockroach-go-logs-on-failure branch 2 times, most recently from bb57c78 to 406ac73 Compare June 14, 2023 14:19
Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

lgtm, but there's a small nit which you can address and feel free to merge after

@@ -1287,6 +1300,7 @@ func (t *logicTest) newTestServerCluster(bootstrapBinaryPath string, upgradeBina
t.clusterCleanupFuncs = append(t.clusterCleanupFuncs, ts.Stop)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: as long as the cleanupFuncs are being added here, should we just have your new callback get appended here too, rather than returning it. either way, it seems better to be consistent either append both cleanupFunctions here, or to the ts.Stop call in the returned function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right, I don't know what I was thinking. Fixed.

This commit makes use of the new `CockroachLogsDirOpt` option
introduced in [1] to pass a custom directory where cockroach logs will
be stored. This directory is relative to TMPDIR, which is part of the
artifacts path when the test runs in CI. With this change, when a
logic test using the cockroach-go config fails, we'll be able to see
both the test logs as well as the cockroach logs themselves. The
latter will be in the `cockroach.stderr` file.

[1] cockroachdb/cockroach-go#170

Epic: none

Release note: None
@renatolabs renatolabs force-pushed the rc/save-cockroach-go-logs-on-failure branch from 406ac73 to 8069f3a Compare June 14, 2023 16:15
@renatolabs
Copy link
Collaborator Author

TFTR!

bors r=rafiss

@craig
Copy link
Contributor

craig bot commented Jun 14, 2023

Build succeeded:

@craig craig bot merged commit 3441110 into cockroachdb:master Jun 14, 2023
7 checks passed
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.

None yet

3 participants