On Mon, 24 Jan 2022 12:02:10 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
>
> @ArnoZeller can you please check if proposed changes fix the test in your 
> environment?
> @bplb can you please have a look at this pr?

@turbanoff I put your change in our nightly test queue. I will check tomorrow 
for the results.

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

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

Reply via email to