Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8211761

java/nio/file/WatchService/LotsOfCancels.java fails by AccessDeniedException

XMLWordPrintable

    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Microsoft Windows [Version 10.0.17134.285]

      A DESCRIPTION OF THE PROBLEM :
      The test java/nio/file/WatchService/LotsOfCancels.java intermittently fails by AccessDeniedException on Windows. The issue was not observed on Linux, MacOS

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      @echo off
      set TESTJDK="C:\Program Files\Java\jdk-10.0.2"
      set JAVAOPTIONS="-Djava.awt.headless=false"
      set TEST= test\java\nio\file\WatchService\LotsOfCancels.java
      set /a failed=0
      set /a count=0
      :loop
        java -jar ..\..\..\jtreg\lib\jtreg.jar -ignore:quiet -v -a -xml ^
            -exclude:test/jbProblemList.txt ^
            -compilejdk:%TESTJDK% ^
            -testjdk:%TESTJDK% ^
            -javaoptions:%JAVAOPTIONS% ^
            -timeoutFactor:2 %TEST%
        if errorlevel 1 set /a failed=1
        set /a count+=1
        echo "%count%. failed=%failed%"
      if %failed% == 0 goto loop


      ACTUAL -
      #section:main
      ----------messages:(4/143)----------
      command: main LotsOfCancels
      reason: Assumed action based on file name: run main LotsOfCancels
      Mode: othervm
      elapsed time (seconds): 7.501
      ----------configuration:(0/0)----------
      ----------System.out:(112/2881)----------
      begin handle 1
      begin poll 16
      begin handle 16
      begin poll 15
      begin handle 15
      begin poll 14
      begin handle 14
      begin poll 13
      begin handle 13
      begin poll 12
      begin handle 12
      begin poll 11
      begin handle 11
      begin poll 10
      begin handle 10
      begin poll 9
      begin handle 9
      begin poll 8
      begin handle 8
      begin poll 7
      begin handle 7
      begin poll 6
      begin handle 6
      begin poll 5
      begin handle 5
      begin poll 4
      begin handle 4
      begin poll 3
      begin handle 3
      begin poll 2
      begin handle 2
      begin poll 1
      WatchService 5 closing ...
      WatchService 5 closed
      poll 5 expected exception java.nio.file.ClosedWatchServiceException
      end poll 5
      end handle 5
      WatchService 14 closing ...
      WatchService 14 closed
      end handle 14
      poll 14 expected exception java.nio.file.ClosedWatchServiceException
      end poll 14
      WatchService 6 closing ...
      WatchService 6 closed
      end handle 6
      poll 6 expected exception java.nio.file.ClosedWatchServiceException
      end poll 6
      WatchService 10 closing ...
      WatchService 10 closed
      end handle 10
      poll 10 expected exception java.nio.file.ClosedWatchServiceException
      end poll 10
      WatchService 2 closing ...
      WatchService 2 closed
      end handle 2
      poll 2 expected exception java.nio.file.ClosedWatchServiceException
      end poll 2
      WatchService 15 closing ...
      WatchService 15 closed
      end handle 15
      poll 15 expected exception java.nio.file.ClosedWatchServiceException
      end poll 15
      WatchService 7 closing ...
      WatchService 7 closed
      end handle 7
      poll 7 expected exception java.nio.file.ClosedWatchServiceException
      end poll 7
      WatchService 3 closing ...
      WatchService 3 closed
      end handle 3
      poll 3 expected exception java.nio.file.ClosedWatchServiceException
      end poll 3
      WatchService 11 closing ...
      WatchService 11 closed
      end handle 11
      poll 11 expected exception java.nio.file.ClosedWatchServiceException
      end poll 11
      WatchService 4 closing ...
      WatchService 4 closed
      end handle 4
      poll 4 expected exception java.nio.file.ClosedWatchServiceException
      end poll 4
      WatchService 16 closing ...
      WatchService 16 closed
      end handle 16
      poll 16 expected exception java.nio.file.ClosedWatchServiceException
      end poll 16
      WatchService 12 closing ...
      WatchService 12 closed
      end handle 12
      poll 12 expected exception java.nio.file.ClosedWatchServiceException
      end poll 12
      WatchService 13 closing ...
      WatchService 13 closed
      end handle 13
      poll 13 expected exception java.nio.file.ClosedWatchServiceException
      end poll 13
      WatchService 1 closing ...
      WatchService 1 closed
      end handle 1
      poll 1 expected exception java.nio.file.ClosedWatchServiceException
      end poll 1
      WatchService 8 closing ...
      WatchService 8 closed
      end handle 8
      poll 8 expected exception java.nio.file.ClosedWatchServiceException
      end poll 8
      WatchService 9 closing ...
      WatchService 9 closed
      end handle 9
      poll 9 expected exception java.nio.file.ClosedWatchServiceException
      end poll 9
      ----------System.err:(27/1953)*----------
      java.nio.file.AccessDeniedException: .\\LotsOfCancels9969089631291144086\\dir-5\\anyfile
      at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
      at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
      at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
      at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:231)
      at java.base/java.nio.file.Files.newByteChannel(Files.java:369)
      at java.base/java.nio.file.Files.createFile(Files.java:640)
      at LotsOfCancels.handle(LotsOfCancels.java:85)
      at LotsOfCancels.lambda$main$0(LotsOfCancels.java:59)
      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      at java.base/java.lang.Thread.run(Thread.java:844)
      java.lang.RuntimeException: Test failed, see log for details
      at LotsOfCancels.main(LotsOfCancels.java:71)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
      at java.base/java.lang.Thread.run(Thread.java:844)

      JavaTest Message: Test threw exception: java.lang.RuntimeException: Test failed, see log for details
      JavaTest Message: shutting down test

      STATUS:Failed.`main' threw exception: java.lang.RuntimeException: Test failed, see log for details

      ---------- BEGIN SOURCE ----------
      http://hg.openjdk.java.net/jdk10/jdk10/jdk/file/777356696811/test/java/nio/file/WatchService/LotsOfCancels.java
      ---------- END SOURCE ----------

      FREQUENCY : often


            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: