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

Make TestViewfsWithNfs3.testNfsRenameSingleNN() idempotent

    XMLWordPrintableJSON

Details

    Description

      The 'org.apache.hadoop.hdfs.nfs.nfs3.TestViewfsWithNfs3.testNfsRenameSingleNN' test is not idempotent and fails if run twice in the same JVM, because it pollutes state shared among tests. It may be good to clean this state pollution so that some other tests do not fail in the future due to the shared state polluted by this test.

      Running TestViewfsWithNfs3.testNfsRenameSingleNN twice would result in the second run failing with a NullPointer exception:

      [ERROR] Errors:
      [ERROR]   TestViewfsWithNfs3.testNfsRenameSingleNN:317 NullPointer
      

      The reason for this is that the /user1/renameSingleNN file is created in setup(), but gets renamed in testNfsRenameSingl{{eNN}}. When the second run of testNfsRenameSingleNN tries to get info of the file by its original name, it returns a NullPointer since the file no longer exists.

       

      Link to PR: https://github.com/apache/hadoop/pull/2724

      Attachments

        1. HDFS-15862.002.patch
          2 kB
          Zhengxi Li
        2. HDFS-15862.001.patch
          1 kB
          Zhengxi Li

        Issue Links

          Activity

            People

              lzx404243 Zhengxi Li
              lzx404243 Zhengxi Li
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m