On Thu, 20 Jan 2022 21:10:39 GMT, Andrey Turbanov <aturba...@openjdk.org> wrote:

> Test `test/java/io/File/GetXSpace.java` always failed on my machine with this 
> output:
> 
> ----------System.out:(12/489)----------
> --- Testing df
> C:/Programs/cygwin64 292848636 49695320 243153316 17% /
> D: 59672 59672 0 100% /cygdrive/d
> 
> 
> SecurityManager = null
> C:/Programs/cygwin64:
>   df total= 299877003264 free = 0 usable = 248988995584
>   getX total= 299877003264 free = 248988995584 usable = 248988995584
> ::
>   df total= 61104128 free = 0 usable = 0
>   getX total= 0 free = 0 usable = 0
> ----------System.err:(23/1617)----------
> 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:232)
> at java.base/java.io.File.toPath(File.java:2396)
> at GetXSpace.compare(GetXSpace.java:223)
> at GetXSpace.testDF(GetXSpace.java:403)
> at GetXSpace.main(GetXSpace.java:437)
> at 
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
> at java.base/java.lang.reflect.Method.invoke(Method.java:577)
> at 
> com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
> at java.base/java.lang.Thread.run(Thread.java:833) 
> 
> Parsing of df output is incorrect. It skips first symbols after matching of 
> line.
> https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L160
> 
> It means that after matching first line:
> 
> C:/Programs/cygwin64 292848636 49695320 243153316 17% /
> 
> 
> It skips first symbols of next line - symbol `D` and then proceeds to match 
> _corrupted_ line:
> 
> : 59672 59672 0 100% /cygdrive/d
> 
> 
> Problems affects only Windows, because only in Windows case first group of 
> matcher is used:
> 
> https://github.com/openjdk/jdk/blob/293fb46f7cd28f2a08055e3eb8ec9459d64e9688/test/jdk/java/io/File/GetXSpace.java#L155-L156
> 
> 
> Testing:
> * Windows x64 - always failed before. No errors after fix
> * Linux x64

This pull request has now been integrated.

Changeset: 178ac746
Author:    Andrey Turbanov <aturba...@openjdk.org>
URL:       
https://git.openjdk.java.net/jdk/commit/178ac7465360729628521a0d555253b9fb2ad7bf
Stats:     6 lines in 1 file changed: 0 ins; 1 del; 5 mod

8251466: test/java/io/File/GetXSpace.java fails on Windows with mapped network 
drives.

Reviewed-by: bpb

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

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

Reply via email to