petersomogyi commented on a change in pull request #2979:
URL: https://github.com/apache/hbase/pull/2979#discussion_r583491127
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestZKSecretWatcher.java
##########
@@ -140,35 +141,35 @@ public void testKeyUpdate() throws Exception {
// sanity check
assertTrue(KEY_MASTER.isMaster());
assertFalse(KEY_SLAVE.isMaster());
- int maxKeyId = 0;
KEY_MASTER.rollCurrentKey();
AuthenticationKey key1 = KEY_MASTER.getCurrentKey();
assertNotNull(key1);
- LOG.debug("Master current key: "+key1.getKeyId());
+ LOG.debug("Master current key (key1) {}", key1);
// wait for slave to update
Thread.sleep(1000);
AuthenticationKey slaveCurrent = KEY_SLAVE.getCurrentKey();
assertNotNull(slaveCurrent);
assertEquals(key1, slaveCurrent);
- LOG.debug("Slave current key: "+slaveCurrent.getKeyId());
+ LOG.debug("Slave current key (key1) {}", slaveCurrent);
// generate two more keys then expire the original
KEY_MASTER.rollCurrentKey();
AuthenticationKey key2 = KEY_MASTER.getCurrentKey();
- LOG.debug("Master new current key: "+key2.getKeyId());
+ LOG.debug("Master new current key (key2) {}", key2);
KEY_MASTER.rollCurrentKey();
AuthenticationKey key3 = KEY_MASTER.getCurrentKey();
- LOG.debug("Master new current key: "+key3.getKeyId());
+ LOG.debug("Master new current key (key3) {}", key3);
// force expire the original key
- key1.setExpiration(EnvironmentEdgeManager.currentTime() - 1000);
+ key1.setExpiration(EnvironmentEdgeManager.currentTime() - 100000);
Review comment:
I'm not sure of the original intention here as the -1000 should also
make the key expired but it doesn't make any difference if the key expired long
time ago.
If you prefer I can revert back this line.
https://github.com/apache/hbase/blob/branch-2.2/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSecretManager.java#L238-L256
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]