oneby-wang opened a new pull request, #25948: URL: https://github.com/apache/pulsar/pull/25948
Fixes #25941 ### Motivation SaslAuthenticateTest.testMaxInflightContext() is flaky because Caffeine may perform size-based eviction asynchronously. The test asserted the cache size immediately after inserting inflight SASL contexts, so it could observe entries before Caffeine maintenance reduced the cache to the configured maximum. ### Modifications - Added package-private test accessors for the SASL authentication state cache. - Forced Caffeine maintenance with cleanUp() before asserting the configured max inflight SASL context size. - Added a regression test that delays Caffeine maintenance to cover the flaky window before verifying cleanUp() applies the configured maximum. - Replaced SASL header, state, and token string literals in the affected tests with SaslConstants constants. ### Verifying this change - [x] Make sure that the change passes the CI checks. ### Does this pull request potentially affect one of the following parts: - [ ] Dependencies (add or upgrade a dependency) - [ ] The public API - [ ] The schema - [ ] The default values of configurations - [ ] The threading model - [ ] The binary protocol - [ ] The REST endpoints - [ ] The admin CLI options - [ ] The metrics - [ ] Anything that affects deployment -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
