-
Notifications
You must be signed in to change notification settings - Fork 6.1k
test: stabilize TestAuditPluginRetrying
#65523
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: tangenta <[email protected]>
|
Hi @tangenta. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Signed-off-by: tangenta <[email protected]>
|
/check-issue-triage-complete |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #65523 +/- ##
================================================
- Coverage 77.8448% 77.6614% -0.1835%
================================================
Files 1971 1895 -76
Lines 540836 528530 -12306
================================================
- Hits 421013 410464 -10549
+ Misses 118164 118060 -104
+ Partials 1659 6 -1653
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/retest |
|
/ok-to-test |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hawkingrei The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/retest |
What problem does this PR solve?
Issue Number: close #65222
Problem Summary:
require.Eventuallywith the predicate "we observed more audit events than issued statements" checkslen(testResults) > concurrency, which only becomes true if at least one statement was retried (extra audit events).testResultswas a shared slice appended by many server goroutines (audit callbacks) while the test goroutine concurrently reset/read it, with no synchronization. Under load this can lose/corrupt entries, solen(testResults)can stay <=concurrencyeven if retries happened.What changed and how does it work?
testResultsthread-safe (mutex + snapshot helpers), and also removes DB usage patterns that make the loop less reliable: it switches fromConn().QueryContext()(noRows/Connclose, error asserts in goroutines) todb.ExecContext()with a sized pool (SetMaxOpenConns/SetMaxIdleConns) and collects errors back in the main goroutine.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.