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

cshannon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit bce2ef2bfc8b3a80dee5cf3e7313fb99b23bb7d1
Merge: b85cafb61c 1531fe5d7e
Author: Christopher L. Shannon <cshan...@apache.org>
AuthorDate: Sat Jan 27 10:38:04 2024 -0500

    Merge branch '2.1'

 .../security/delegation/AuthenticationTokenSecretManagerTest.java   | 6 ++++++
 1 file changed, 6 insertions(+)

diff --cc 
server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenSecretManagerTest.java
index 8a7b6ea7bf,00d9e6cf03..7198e16883
--- 
a/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenSecretManagerTest.java
+++ 
b/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenSecretManagerTest.java
@@@ -207,9 -207,13 +207,15 @@@ public class AuthenticationTokenSecretM
      // The passwords line up against multiple calls with the same ID
      assertArrayEquals(password, secretManager.retrievePassword(id));
  
+     // Sleep 50 ms to make sure we generate another token for the test
+     // System.currentTimeMillis() is used as part of the token generation and 
if
+     // the test runs fast enough it can return the same value that was used
+     // when generating the first token and the test will fail
+     Thread.sleep(50);
+ 
      // Make a second token for the same user
 +    // Briefly sleep to guarantee token is unique, since the token is based 
on the time
 +    Thread.sleep(100);
      Entry<Token<AuthenticationTokenIdentifier>,AuthenticationTokenIdentifier> 
pair2 =
          secretManager.generateToken(principal, cfg);
      Token<AuthenticationTokenIdentifier> token2 = pair2.getKey();

Reply via email to