joseluisll commented on code in PR #9020:
URL: https://github.com/apache/hadoop/pull/9020#discussion_r4667879874


##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestZKDelegationTokenSecretManager.java:
##########
@@ -530,6 +530,7 @@ public Boolean get() {
           return dtinfo == null;
         }
       }, 100, 5000);
+      tm.renewToken(token, "good");

Review Comment:
   Good catch - done in c430ef661f0. The test no longer relies on a wall-clock 
expiry window:
   
   - Dropped the `renewToken` call before shutdown and gave the token a 
generous renewal window (60s), so it cannot expire while the first manager 
shuts down and the second one starts.
   - After the restarted manager is confirmed to have loaded the token into 
memory (the `waitFor` on `getTokenInfoFromMemory`), the test now forces expiry 
by rewriting the token's `renewDate` into the past via 
`ZKDelegationTokenSecretManager#updateToken` (same-package, test-only), and 
then waits for the expired token to be removed from ZK with a bounded `waitFor` 
(30s cap).
   
   So expiry now starts only after the load assertion, as suggested. Verified 
locally: `TestZKDelegationTokenSecretManager` passes (12/12).



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