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

TestByteRangeInputStream.testPropagatedClose fails and throw NPE on branch-2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.5.0
    • 2.6.0
    • test
    • None
    • 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.002.patch
          12 kB
          Juan Yu
        2. HDFS-7049-branch-2.patch
          12 kB
          Juan Yu

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: