Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-33

Ozone : Fix the test logic in TestKeySpaceManager#testDeleteKey

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.2.1
    • Ozone Manager
    • 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.

      Attachments

        1. HDDS-33.01.patch
          1 kB
          Shashikant Banerjee
        2. HDFS-13454.000.patch
          4 kB
          Shashikant Banerjee
        3. HDFS-13454-HDFS-7240.000.patch
          4 kB
          Shashikant Banerjee

        Activity

          People

            shashikant Shashikant Banerjee
            shashikant Shashikant Banerjee
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: