Details
-
Test
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
The test logic in TestKeySpaceManager#testDeleteKey seems to be wrong. The test validates the keyArgs instead of blockId to make sure the key gets deleted from SCM. Also, after the first exception validation , the subsequent statements in the junit never gets executed here.
keys.add(keyArgs.getResourceName()); exception.expect(IOException.class); exception.expectMessage("Specified block key does not exist"); cluster.getStorageContainerManager().getBlockLocations(keys); // Delete the key again to test deleting non-existing key. // These will never get executed. exception.expect(IOException.class); exception.expectMessage("KEY_NOT_FOUND"); storageHandler.deleteKey(keyArgs); Assert.assertEquals(1 + numKeyDeleteFails, ksmMetrics.getNumKeyDeletesFails());
The test needs to be modified to address all these.