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

test: remove time-based checking #1002

Merged
merged 3 commits into from
Mar 4, 2025
Merged

Conversation

lance6716
Copy link
Collaborator

close #988

check a counter to verify cache really takes effect

@lance6716 lance6716 requested a review from Copilot February 27, 2025 10:21

Choose a reason for hiding this comment

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

PR Overview

This PR removes time-based checks in cache tests and replaces them with a counter-based mechanism to verify that caching is effective.

  • Removed timing-based measurements from TestCachingSha2Cache and TestCachingSha2CacheTLS.
  • Introduced an atomic counter (getCredCallCnt) in RemoteThrottleProvider to confirm that GetCredential is called only once.
  • Updated tests to assert the new counter value after establishing connections.

Reviewed Changes

File Description
server/caching_sha2_cache_test.go Replaced delay-based timing checks with an atomic counter verification mechanism.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

server/caching_sha2_cache_test.go:63

  • [nitpick] Consider renaming 'getCredCallCnt' to 'getCredCallCount' for improved clarity.
getCredCallCnt atomic.Int64
@lance6716
Copy link
Collaborator Author

@dveeden PTAL

@lance6716 lance6716 merged commit b39e40d into go-mysql-org:master Mar 4, 2025
15 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.

flaky test TestCachingSha2CacheTLS/TestCache
2 participants