--- old/test/java/nio/file/WatchService/Basic.java Tue Feb 7 11:17:24 2012 +++ new/test/java/nio/file/WatchService/Basic.java Tue Feb 7 11:17:23 2012 @@ -25,7 +25,7 @@ * @bug 4313887 6838333 7017446 * @summary Unit test for java.nio.file.WatchService * @library .. - * @run main/timeout=120 Basic + * @run main Basic */ import java.nio.file.*; @@ -281,11 +281,11 @@ System.out.println("poll with timeout..."); try { - long start = System.currentTimeMillis(); + long start = System.nanoTime(); key = watcher.poll(3000, TimeUnit.MILLISECONDS); if (key != null) throw new RuntimeException("no keys registered"); - long waited = System.currentTimeMillis() - start; + long waited = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start); if (waited < 2900) throw new RuntimeException("poll was too short"); } catch (InterruptedException x) { @@ -358,7 +358,7 @@ } // assume that poll throws exception immediately - long start = System.currentTimeMillis(); + long start = System.nanoTime(); try { watcher.poll(10000, TimeUnit.MILLISECONDS); throw new RuntimeException("ClosedWatchServiceException not thrown"); @@ -365,7 +365,7 @@ } catch (InterruptedException x) { throw new RuntimeException(x); } catch (ClosedWatchServiceException x) { - long waited = System.currentTimeMillis() - start; + long waited = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start); if (waited > 5000) throw new RuntimeException("poll was too long"); } --- old/test/java/nio/file/WatchService/SensitivityModifier.java Tue Feb 7 11:17:26 2012 +++ new/test/java/nio/file/WatchService/SensitivityModifier.java Tue Feb 7 11:17:25 2012 @@ -23,9 +23,9 @@ /* @test * @bug 4313887 - * @summary Sanity test for Sun-specific sensitivyt level watch event modifier + * @summary Sanity test for Sun-specific sensitivity level watch event modifier * @library .. - * @run main/timeout=330 Basic + * @run main/timeout=240 SensitivityModifier */ import java.nio.file.*;