YARN-8904. TestRMDelegationTokens can fail in testRMDTMasterKeyStateOnRollingMasterKey. Contributed by Wilfred Spiegelenburg
(cherry picked from commit 93fb3b4b9c
)
This commit is contained in:
parent
e4464f9598
commit
a9bc3e3708
|
@ -97,7 +97,17 @@ public class TestRMDelegationTokens {
|
|||
RMDelegationTokenSecretManager dtSecretManager =
|
||||
rm1.getRMContext().getRMDelegationTokenSecretManager();
|
||||
// assert all master keys are saved
|
||||
Assert.assertEquals(dtSecretManager.getAllMasterKeys(), rmDTMasterKeyState);
|
||||
dtSecretManager.getAllMasterKeys().forEach(managerKey -> {
|
||||
int keyId = managerKey.getKeyId();
|
||||
boolean found = false;
|
||||
for (DelegationKey stateKey: rmDTMasterKeyState) {
|
||||
if (stateKey.getKeyId() == keyId) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Assert.assertTrue("Master key not found: " + keyId, found);
|
||||
});
|
||||
|
||||
// request to generate a RMDelegationToken
|
||||
GetDelegationTokenRequest request = mock(GetDelegationTokenRequest.class);
|
||||
|
|
Loading…
Reference in New Issue