This is an automated email from the ASF dual-hosted git repository.

michaelsmith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new 3c8a7b8dc IMPALA-14676: Test cookie rotation on 25000
3c8a7b8dc is described below

commit 3c8a7b8dc1c051f1287815d1924f5da7197cc45a
Author: Michael Smith <[email protected]>
AuthorDate: Mon Jan 12 14:14:42 2026 -0800

    IMPALA-14676: Test cookie rotation on 25000
    
    Rearranges testWebserverSharedCookie to test rotation on the original
    impalad at port 25000, since that's the server verifyMetrics queries.
    
    Fixes an intermittent failure due to waiting for impalad at port 25001
    to reload the cookie but then verifying metrics on impalad at 25000,
    which may not have reloaded the cookie yet.
    
    Tested by running testWebserverSharedCookie 20 times; previously it
    failed consistently within that sample.
    
    Change-Id: I864ffed5f14bbfd2c6dd155a91150648d960c2a6
    Reviewed-on: http://gerrit.cloudera.org:8080/23860
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Reviewed-by: Jason Fehr <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 .../impala/customcluster/LdapWebserverTest.java     | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git 
a/fe/src/test/java/org/apache/impala/customcluster/LdapWebserverTest.java 
b/fe/src/test/java/org/apache/impala/customcluster/LdapWebserverTest.java
index fdcd9fa5d..be7ddec75 100644
--- a/fe/src/test/java/org/apache/impala/customcluster/LdapWebserverTest.java
+++ b/fe/src/test/java/org/apache/impala/customcluster/LdapWebserverTest.java
@@ -187,19 +187,19 @@ public class LdapWebserverTest {
     // there will already be some successful auth attempts.
     verifyMetrics(Range.atLeast(1L), zero, Range.atLeast(1L), zero);
 
-    // Attempt to access the webserver without a username/password, only the 
cookie from
-    // the verifyMetrics calls.
-    try (WebClient cookieOnly = new WebClient("", "", 25000, 
client_.getCookies())) {
+    // Access a different webserver with the cookie from verifyMetrics calls, 
should
+    // succeed.
+    try (WebClient cookieOnly = new WebClient("", "", 25001, 
client_.getCookies())) {
       String result = cookieOnly.readContent("/");
       assertTrue(result, result.contains("<title>Apache Impala</title>"));
-      // Check that there were no unsuccessful auth attempts.
-      verifyMetrics(Range.atLeast(1L), zero, Range.atLeast(1L), zero);
     }
 
-    // Access a different webserver with the same cookie, should succeed.
-    try (WebClient cookieOnly = new WebClient("", "", 25001, 
client_.getCookies())) {
+    // Access the original webserver, then reload the cookie.
+    try (WebClient cookieOnly = new WebClient("", "", 25000, 
client_.getCookies())) {
       String result = cookieOnly.readContent("/");
       assertTrue(result, result.contains("<title>Apache Impala</title>"));
+      // Check that there were no unsuccessful auth attempts.
+      verifyMetrics(Range.atLeast(1L), zero, Range.atLeast(1L), zero);
 
       // Cookie should be reloaded with the new key.
       writeCookieSecret(keyFile);
@@ -211,8 +211,11 @@ public class LdapWebserverTest {
         return res;
       }, 20, 100);
       assertTrue(result, result.contains("Must authenticate with Basic 
authentication."));
-      // Check that there is an unsuccessful cookie attempt.
-      verifyMetrics(Range.atLeast(1L), zero, Range.atLeast(1L), 
Range.closed(1L, 1L));
+      // Check that there is an unsuccessful cookie attempt, which also 
generates an
+      // unsuccessful basic auth attempt since the cookie is invalid. There is 
a 2nd
+      // cookie failure from client_ reconnecting.
+      verifyMetrics(Range.atLeast(1L), Range.closed(1L, 1L),
+          Range.atLeast(1L), Range.closed(2L, 2L));
     }
   }
 

Reply via email to