RFR: 8080272 Refactor I/O stream copying to use InputStream.transferTo/readAllBytes and Files.copy [v8]

Andrey Turbanov github.com+741251+turbanoff at openjdk.java.net
Fri Feb 12 21:09:41 UTC 2021


On Fri, 12 Feb 2021 21:03:04 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:

>> I've updated the issue summary to better reflect the changes, the PR summary should be renamed accordingly. 
>> As mentioned earlier, have you run the tests for the affected areas? Here's some information on how to do that: http://openjdk.java.net/guide/#testing-the-jdk
>
> I rebased my changes onto master. (commit 837bd8930d0a010110f1318b947c036609d3aa33)
> and checked tier2 and tier3.
> What I got:
> 
>     ==============================
>     Test summary
>     ==============================
>        TEST                                              TOTAL  PASS  FAIL ERROR   
>     >> jtreg:test/jdk:tier2                               3698  3690     6     2 <<
>     >> jtreg:test/langtools:tier2                           12    11     1     0 <<
>        jtreg:test/jaxp:tier2                               450   450     0     0   
>     ==============================
>     TEST FAILURE
> 
> 
> 
> 
>     ==============================
>     Test summary
>     ==============================
>        TEST                                              TOTAL  PASS  FAIL ERROR   
>     >> jtreg:test/jdk:tier3                               1190  1188     2     0 <<
>        jtreg:test/langtools:tier3                            0     0     0     0   
>        jtreg:test/jaxp:tier3                                 0     0     0     0   
>     ==============================
>     TEST FAILURE
> 
> 
> Failed tests:
> 
>      tier2:
>      java/io/File/GetXSpace.java                                                                         Failed. Execution failed: `main' threw exception: java.nio.file.InvalidPathException: Illegal char <:> at index 0: :
>      java/net/MulticastSocket/MulticastAddresses.java                                                    Failed. Execution failed: `main' threw exception: java.lang.Exception: 1 test(s) failed - see log file.
>      java/net/MulticastSocket/SetLoopbackMode.java                                                       Failed. Execution failed: `main' threw exception: java.net.NoRouteToHostException: No route to host: no further information
>      java/nio/file/Files/CopyAndMove.java                                                                Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: AtomicMoveNotSupportedException expected
>      java/security/AccessController/DoPrivAccompliceTest.java                                            Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: 'user' found in stderr
>      tools/jpackage/share/jdk/jpackage/tests/UnicodeArgsTest.java                                        Failed. Execution failed: `main' threw exception: jdk.jpackage.test.Functional$ExceptionBox: java.lang.RuntimeException: 2 FAILED TESTS
>      
>      sun/security/tools/jarsigner/TimestampCheck.java                                                    Error. Agent error: java.lang.Exception: Agent 72 timed out with a timeout of 2400 seconds; check console log for any additional details
>      sun/security/tools/keytool/DefaultOptions.java                                                      Error. Agent error: java.lang.Exception: Agent 77 timed out with a timeout of 480 seconds; check console log for any additional details
>      
>      jdk/jshell/ToolBasicTest.java                              Failed. Execution failed: `main' threw exception: java.lang.Exception: failures: 1
>      
>      tier3:
>      sanity/client/SwingSet/src/SwingSet2DemoTest.java                                                                  Failed. Execution failed: `main' threw exception: java.lang.Exception: failures: 1
>      sanity/client/SwingSet/src/ColorChooserDemoTest.java                                                               Failed. Execution failed: `main' threw exception: java.lang.Exception: failures: 1

Then I tried to run tests separately:
## java/io/File/GetXSpace.java


    make test TEST="jtreg:test/jdk/java/io/File/GetXSpace.java"

    STDERR:
    java.nio.file.InvalidPathException: Illegal char <:> at index 0: :
            at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
            at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
            at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
            at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
            at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:230)
            at java.base/java.io.File.toPath(File.java:2316)
            at GetXSpace.compare(GetXSpace.java:219)
            at GetXSpace.testDF(GetXSpace.java:394)
            at GetXSpace.main(GetXSpace.java:428)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:566)
            at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
            at java.base/java.lang.Thread.run(Thread.java:831)

    JavaTest Message: Test threw exception: java.nio.file.InvalidPathException
    JavaTest Message: shutting down test

    STDOUT:
    --- Testing df
    C:/Programs/cygwin64   350809332  172573816 178235516      50% /
    D:                    3702215676 2812548988 889666688      76% /cygdrive/d
    E:                    3906885628 3544182676 362702952      91% /cygdrive/e
    F:                     250057724  240917056   9140668      97% /cygdrive/f


    SecurityManager = null
    C:/Programs/cygwin64:
      df   total= 359228755968 free =            0 usable = 182513168384
      getX total= 359228755968 free = 182513168384 usable = 182513168384
    ::
      df   total= 3791068852224 free =            0 usable = 911018688512
      getX total=            0 free =            0 usable =            0

    TEST RESULT: Failed. Execution failed: `main' threw exception: java.nio.file.InvalidPathException: Illegal char <:> at index 0: :
--------------------------------------------------


https://bugs.openjdk.java.net/browse/JDK-8251466 looks like there is already known bug for similar cygwin output.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1853


More information about the security-dev mailing list