8207316: java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java failed
authormli
Thu, 19 Jul 2018 16:22:19 +0800
changeset 51117 c96c7d08ae49
parent 51116 7e34f3da2293
child 51118 2467bd84c59b
child 56838 4b73e9ef108a
8207316: java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java failed Reviewed-by: alanb, simonis
test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/CloseTest.java
test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoService.java
test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoTest.java
test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java
test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/StateTest.java
--- a/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/CloseTest.java	Wed Jul 18 16:13:21 2018 -0700
+++ b/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/CloseTest.java	Thu Jul 19 16:22:19 2018 +0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,8 @@
 import java.nio.channels.Selector;
 import java.nio.channels.SocketChannel;
 
+import jdk.test.lib.Utils;
+
 public class CloseTest {
 
     public static void main(String args[]) throws Exception {
@@ -50,7 +52,7 @@
 
         String service_args[] = new String[2];
         service_args[0] = String.valueOf(msg.length());
-        service_args[1] = String.valueOf( 15*1000 );
+        service_args[1] = String.valueOf( Utils.adjustTimeout(15*1000) );
 
 
         SocketChannel sc = Launcher.launchWithSocketChannel("EchoService", service_args);
@@ -65,7 +67,7 @@
         Selector sel = sc.provider().openSelector();
         SelectionKey sk = sc.register(sel, SelectionKey.OP_READ);
 
-        long to = 12 * 1000;
+        long to = Utils.adjustTimeout(12*1000);
         for (;;) {
             long st = System.currentTimeMillis();
             sel.select(to);
--- a/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoService.java	Wed Jul 18 16:13:21 2018 -0700
+++ b/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoService.java	Thu Jul 19 16:22:19 2018 +0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -65,6 +65,8 @@
 import java.nio.channels.ServerSocketChannel;
 import java.nio.channels.SocketChannel;
 
+import jdk.test.lib.Utils;
+
 public class EchoService {
 
     private static void doIt(SocketChannel sc, int closeAfter, int delay) throws IOException {
@@ -173,7 +175,7 @@
             SocketChannel sc;
             int count = 0;
             for (;;) {
-                 sel.select(5000);
+                 sel.select((int)Utils.adjustTimeout(5000));
                  if (sk.isAcceptable() && ((sc = ssc.accept()) != null)) {
                     Worker w = new Worker(sc);
                     (new Thread(w)).start();
--- a/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoTest.java	Wed Jul 18 16:13:21 2018 -0700
+++ b/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoTest.java	Thu Jul 19 16:22:19 2018 +0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,8 @@
 import java.nio.channels.SocketChannel;
 import java.util.Random;
 
+import jdk.test.lib.Utils;
+
 public class EchoTest {
 
     private static int failures = 0;
@@ -80,7 +82,7 @@
         Selector sel = sc.provider().openSelector();
         SelectionKey sk = sc.register(sel, SelectionKey.OP_READ);
         int nread = 0;
-        long to = 5000;
+        long to = Utils.adjustTimeout(5000);
         while (nread < size) {
             long st = System.currentTimeMillis();
             sel.select(to);
@@ -144,7 +146,7 @@
         // and receive the echo
         byte b[] = new byte[msg.length() + 100];
         DatagramPacket pkt2 = new DatagramPacket(b, b.length);
-        dc.socket().setSoTimeout(5000);
+        dc.socket().setSoTimeout((int)Utils.adjustTimeout(5000));
         dc.socket().receive(pkt2);
 
         if (pkt2.getLength() != msg.length()) {
--- a/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java	Wed Jul 18 16:13:21 2018 -0700
+++ b/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java	Thu Jul 19 16:22:19 2018 +0800
@@ -57,7 +57,7 @@
 public class InheritedChannelTest {
 
     private static final String TEST_SRC = System.getProperty("test.src");
-    private static final String TEST_CLASSES = System.getProperty("test.classes");
+    private static final String TEST_CLASSES = System.getProperty("test.class.path");
     private static final Path POLICY_PASS = Paths.get(TEST_SRC, "java.policy.pass");
     private static final Path POLICY_FAIL = Paths.get(TEST_SRC, "java.policy.fail");
 
--- a/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/StateTest.java	Wed Jul 18 16:13:21 2018 -0700
+++ b/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/StateTest.java	Thu Jul 19 16:22:19 2018 +0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,8 @@
 import java.nio.channels.ServerSocketChannel;
 import java.nio.channels.SocketChannel;
 
+import jdk.test.lib.Utils;
+
 public class StateTest {
 
     private static int failures = 0;
@@ -66,7 +68,7 @@
          */
         ssc.configureBlocking(false);
         sk = ssc.register(sel, SelectionKey.OP_ACCEPT);
-        long to = 15*1000;
+        long to = Utils.adjustTimeout(15*1000);
         sc = null;
         for (;;) {
             long st = System.currentTimeMillis();
@@ -89,7 +91,7 @@
          */
         sc.configureBlocking(false);
         sk = sc.register(sel, SelectionKey.OP_READ);
-        to = 5000;
+        to = Utils.adjustTimeout(5000);
         ByteBuffer bb = ByteBuffer.allocateDirect(20);
         for (;;) {
             long st = System.currentTimeMillis();