Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-14029

Sleep in TestLazyPersistFiles should be put into a loop

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.4, 3.1.2, 3.3.0, 3.2.1
    • Component/s: hdfs
    • Labels:
    • Hadoop Flags:
      Reviewed

      Description

      TestLazyPersistFiles#testFileShouldNotDiscardedIfNNRestarted test should be improved.

      The test sleeps for 6000 at once, it could at least sleep in a loop checking for the corrupt block to be reported.

          cluster.shutdownDataNodes();
      
          cluster.restartNameNodes();
      
          // wait for the redundancy monitor to mark the file as corrupt.
          Thread.sleep(2 * DFS_NAMENODE_REDUNDANCY_INTERVAL_SECONDS_DEFAULT * 1000);
      
          Long corruptBlkCount = (long) Iterators.size(cluster.getNameNode()
              .getNamesystem().getBlockManager().getCorruptReplicaBlockIterator());
      

      Thanks Kitti Nanasi for the suggestion.

        Attachments

        1. HDFS-14029.001.patch
          2 kB
          Adam Antal
        2. HDFS-14029.branch-2.001.patch
          2 kB
          Adam Antal

          Activity

            People

            • Assignee:
              adam.antal Adam Antal
              Reporter:
              adam.antal Adam Antal
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: