seawinde commented on code in PR #61673:
URL: https://github.com/apache/doris/pull/61673#discussion_r2998595676


##########
fe/fe-core/src/test/java/org/apache/doris/mysql/authenticate/ldap/LdapAuthenticatorTest.java:
##########
@@ -139,8 +161,64 @@ public void testCanDeal() {
         Assert.assertFalse(ldapAuthenticator.canDeal("ss"));
     }
 
+    @Test
+    public void testCanDealLogsInfoWithoutThreshold() {
+        setLdapUserExist(true);
+        try (LdapTestLogAppender appender = 
LdapTestLogAppender.attach(LdapAuthenticator.class)) {
+            Assert.assertTrue(ldapAuthenticator.canDeal("ss"));
+            Assert.assertTrue(appender.contains(Level.INFO,
+                    "[LDAP-AUTH] LdapAuthenticator.canDeal: user=ss, 
result=true, elapsed="));
+            Assert.assertFalse(appender.contains(Level.WARN,
+                    "[LDAP-AUTH] LdapAuthenticator.canDeal slow: user=ss"));
+        }
+    }
+
     @Test
     public void testGetPasswordResolver() {
         Assert.assertTrue(ldapAuthenticator.getPasswordResolver() instanceof 
ClearPasswordResolver);
     }
+
+    static class LdapTestLogAppender extends AbstractAppender implements 
AutoCloseable {
+        private final Logger logger;

Review Comment:
   fixed it



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to