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

sql: fix TestCaptureIndexUsageStats #110639

Merged
merged 1 commit into from
Sep 15, 2023
Merged

Conversation

maryliag
Copy link
Contributor

@maryliag maryliag commented Sep 14, 2023

Tests can take longer to be completed, so a bigger time buffer
would be required to accomodate for the non-determinism in
the logging timings. This time buffer has been increasing every
couple of months and it would have to change to 5s now, which is
a big buffer compared to the actual value of 1s. The time it takes
is not really relevant for this test, as long as the schedules
are happening one after the other.
So instead of increasing the time buffer even more, this commit
removes those checks. This way the test is no longer flaky or would need
to be adjusted every few months, and we keep all the actual checks
important for the test.

Fixes #110617

Release note: None

@maryliag maryliag added the backport-23.1.x Flags PRs that need to be backported to 23.1 label Sep 14, 2023
@maryliag maryliag requested a review from a team September 14, 2023 13:20
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@maryliag maryliag changed the title sql: increase buffer on TestCaptureIndexUsageStats sql: fix TestCaptureIndexUsageStats Sep 14, 2023
Copy link
Contributor

@zachlite zachlite left a comment

Choose a reason for hiding this comment

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

:lgtm:

The time it takes is not really relevant for this test

nit / question: Can we just delete these assertions altogether? It seems obvious to expect something to take longer than 0 seconds. (As much as I wish that things could be instant 😄 )

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

@j82w
Copy link
Contributor

j82w commented Sep 14, 2023

pkg/sql/scheduledlogging/captured_index_usage_stats_test.go line 282 at r1 (raw file):

		actualDuration := time.Duration(currentTimestamp - previousTimestamp)
		require.GreaterOrEqual(t, expectedDuration, 0*time.Second, "expectedDuration %v should be >= 0")

Why would it be equal to 0? Isn't that a bug as everything should take some amount of time.

Tests can take longer to be completed, so a bigger time buffer
would be required to accomodate for the non-determinism in
the logging timings. This time buffer has been increasing every
couple of months and it would have to change to 5s now, which is
a big buffer compared to the actual value of 1s. The time it takes
is not really relevant for this test, as long as the schedules
are happening one after the other.
So instead of increasing the time buffer even more, this commit
removes those checks. This way the test is no longer flaky or would need
to be adjusted every few months, and we keep all the actual checks
important for the test.

Fixes cockroachdb#110617

Release note: None
Copy link
Contributor Author

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

Yeah, makes more sense to remove them, since they're not adding.

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


pkg/sql/scheduledlogging/captured_index_usage_stats_test.go line 282 at r1 (raw file):

Previously, j82w (Jake) wrote…

Why would it be equal to 0? Isn't that a bug as everything should take some amount of time.

I decided to remove those checks altogether, since they should always be greater than 0 anyway

@maryliag
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 15, 2023

Build succeeded:

@craig craig bot merged commit c3e6bb2 into cockroachdb:master Sep 15, 2023
@maryliag maryliag deleted the increase-buffer branch September 15, 2023 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql/scheduledlogging: TestCaptureIndexUsageStats failed
4 participants