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

telemetryccl: use log spy in backup/restore test #120646

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

dhartunian
Copy link
Collaborator

Previously this test used file logging to test the telemetry output, which can result in flakes on CI. This commit modifies the test to use a log spy which is a bit more reliable. Additionally, the deserialization now happens in the Intercept() method which makes the test easier to read.

Resolves: #120115
Epic: None
Release note: None

@dhartunian dhartunian requested review from ZhouXing19, a team and abarganier and removed request for a team March 18, 2024 15:12
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@abarganier abarganier left a comment

Choose a reason for hiding this comment

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

:lgtm: - love this log spy pattern!

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @dhartunian and @ZhouXing19)


pkg/ccl/telemetryccl/telemetry_logging_test.go line 167 at r1 (raw file):

	var rawLog logpb.Entry
	if err := json.Unmarshal(entry, &rawLog); err != nil {
		return

nit: should we try logging something if we fail to unmarshal here and the two places below?

Code quote:

		return

Previously this test used file logging to test the telemetry output,
which can result in flakes on CI. This commit modifies the test to use
a log spy which is a bit more reliable. Additionally, the
deserialization now happens in the `Intercept()` method which makes
the test easier to read.

Resolves: cockroachdb#120115
Epic: None
Release note: None
@dhartunian dhartunian force-pushed the telemetry-logging-job-test branch from 1223fe4 to cffcc30 Compare March 19, 2024 16:48
Copy link
Collaborator Author

@dhartunian dhartunian 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! 1 of 0 LGTMs obtained (waiting on @ZhouXing19)


pkg/ccl/telemetryccl/telemetry_logging_test.go line 167 at r1 (raw file):

Previously, abarganier (Alex Barganier) wrote…

nit: should we try logging something if we fail to unmarshal here and the two places below?

Done.

@dhartunian
Copy link
Collaborator Author

bors r=abarganier

@craig
Copy link
Contributor

craig bot commented Mar 20, 2024

@craig craig bot merged commit f0116ea into cockroachdb:master Mar 20, 2024
21 of 22 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.

pkg/ccl/telemetryccl/telemetryccl_test: TestBulkJobTelemetryLogging failed
3 participants