Skip to content

Conversation

@tangenta
Copy link
Contributor

@tangenta tangenta commented Jan 12, 2026

What problem does this PR solve?

Issue Number: close #65222

Problem Summary:

  • require.Eventually with the predicate "we observed more audit events than issued statements" checks len(testResults) > concurrency, which only becomes true if at least one statement was retried (extra audit events).
  • Before the change, testResults was 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, so len(testResults) can stay <= concurrency even if retries happened.

What changed and how does it work?

  • The change makes testResults thread-safe (mutex + snapshot helpers), and also removes DB usage patterns that make the loop less reliable: it switches from Conn().QueryContext() (no Rows/Conn close, error asserts in goroutines) to db.ExecContext() with a sized pool (SetMaxOpenConns/SetMaxIdleConns) and collects errors back in the main goroutine.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-tests-checked size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/needs-tests-checked labels Jan 12, 2026
@tiprow
Copy link

tiprow bot commented Jan 12, 2026

Hi @tangenta. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Details

Instructions 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]>
@tangenta
Copy link
Contributor Author

/check-issue-triage-complete

@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.6614%. Comparing base (69a1b2c) to head (6f3628b).
⚠️ Report is 1 commits behind head on master.

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     
Flag Coverage Δ
integration 41.5623% <ø> (-6.6372%) ⬇️
unit 76.7648% <ø> (+0.3188%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 56.7974% <ø> (ø)
parser ∅ <ø> (∅)
br 48.8077% <ø> (-12.3142%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hawkingrei
Copy link
Member

/retest

@hawkingrei
Copy link
Member

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Jan 12, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jan 12, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 12, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jan 12, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-01-12 03:45:29.451995331 +0000 UTC m=+242773.513860267: ☑️ agreed by hawkingrei.

@hawkingrei
Copy link
Member

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flaky test TestAuditPluginRetrying

2 participants