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

TestByteRangeInputStream.testPropagatedClose fails and throw NPE on branch-2

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.0
    • Fix Version/s: 2.6.0
    • Component/s: test
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      On branch-2, TestByteRangeInputStream.testPropagatedClose throw NPE when HftpFileSystem$RangeHeaderUrlOpener.connect
      This is due to fix of HDFS-6143 "WebHdfsFileSystem open should throw FileNotFoundException for non-existing paths"
      public ByteRangeInputStream(URLOpener o, URLOpener r) throws IOException

      { this.originalURL = o; this.resolvedURL = r; getInputStream(); }

      the getInputStream() will be called in constructor now to verify if file exists.
      Since we just try to test if ByteRangeInputStream#close is called at proper time, we could mock(ByteRangeInputStream.class, CALLS_REAL_METHODS) for testing to avoid the NPE issue.
      I believe the trunk version already does this, we just need to merge the test from trunk.

        Attachments

        1. HDFS-7049-branch-2.patch
          12 kB
          Juan Yu
        2. HDFS-7049-branch-2.002.patch
          12 kB
          Juan Yu

          Issue Links

            Activity

              People

              • Assignee:
                jyu@cloudera.com Juan Yu
                Reporter:
                jyu@cloudera.com Juan Yu
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: