Skip to content

Commit 5c8a0b4

Browse files
committed
8207316: java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java failed
Backport-of: 069fa39
1 parent 8ec02f3 commit 5c8a0b4

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/CloseTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,8 @@
3838
import java.nio.channels.Selector;
3939
import java.nio.channels.SocketChannel;
4040

41+
import jdk.test.lib.Utils;
42+
4143
public class CloseTest {
4244

4345
public static void main(String args[]) throws Exception {
@@ -50,7 +52,7 @@ public static void main(String args[]) throws Exception {
5052

5153
String service_args[] = new String[2];
5254
service_args[0] = String.valueOf(msg.length());
53-
service_args[1] = String.valueOf( 15*1000 );
55+
service_args[1] = String.valueOf( Utils.adjustTimeout(15*1000) );
5456

5557

5658
SocketChannel sc = Launcher.launchWithSocketChannel("EchoService", service_args);
@@ -65,7 +67,7 @@ public static void main(String args[]) throws Exception {
6567
Selector sel = sc.provider().openSelector();
6668
SelectionKey sk = sc.register(sel, SelectionKey.OP_READ);
6769

68-
long to = 12 * 1000;
70+
long to = Utils.adjustTimeout(12*1000);
6971
for (;;) {
7072
long st = System.currentTimeMillis();
7173
sel.select(to);

test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -65,6 +65,8 @@
6565
import java.nio.channels.ServerSocketChannel;
6666
import java.nio.channels.SocketChannel;
6767

68+
import jdk.test.lib.Utils;
69+
6870
public class EchoService {
6971

7072
private static void doIt(SocketChannel sc, int closeAfter, int delay) throws IOException {
@@ -173,7 +175,7 @@ public static void main(String args[]) throws IOException {
173175
SocketChannel sc;
174176
int count = 0;
175177
for (;;) {
176-
sel.select(5000);
178+
sel.select((int)Utils.adjustTimeout(5000));
177179
if (sk.isAcceptable() && ((sc = ssc.accept()) != null)) {
178180
Worker w = new Worker(sc);
179181
(new Thread(w)).start();

test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,8 @@
4444
import java.nio.channels.SocketChannel;
4545
import java.util.Random;
4646

47+
import jdk.test.lib.Utils;
48+
4749
public class EchoTest {
4850

4951
private static int failures = 0;
@@ -80,7 +82,7 @@ private static void TCPEchoTest() throws IOException {
8082
Selector sel = sc.provider().openSelector();
8183
SelectionKey sk = sc.register(sel, SelectionKey.OP_READ);
8284
int nread = 0;
83-
long to = 5000;
85+
long to = Utils.adjustTimeout(5000);
8486
while (nread < size) {
8587
long st = System.currentTimeMillis();
8688
sel.select(to);
@@ -144,7 +146,7 @@ private static void UDPEchoTest() throws IOException {
144146
// and receive the echo
145147
byte b[] = new byte[msg.length() + 100];
146148
DatagramPacket pkt2 = new DatagramPacket(b, b.length);
147-
dc.socket().setSoTimeout(5000);
149+
dc.socket().setSoTimeout((int)Utils.adjustTimeout(5000));
148150
dc.socket().receive(pkt2);
149151

150152
if (pkt2.getLength() != msg.length()) {

test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
public class InheritedChannelTest {
5858

5959
private static final String TEST_SRC = System.getProperty("test.src");
60-
private static final String TEST_CLASSES = System.getProperty("test.classes");
60+
private static final String TEST_CLASSES = System.getProperty("test.class.path");
6161
private static final Path POLICY_PASS = Paths.get(TEST_SRC, "java.policy.pass");
6262
private static final Path POLICY_FAIL = Paths.get(TEST_SRC, "java.policy.fail");
6363

test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/StateTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,8 @@
4242
import java.nio.channels.ServerSocketChannel;
4343
import java.nio.channels.SocketChannel;
4444

45+
import jdk.test.lib.Utils;
46+
4547
public class StateTest {
4648

4749
private static int failures = 0;
@@ -66,7 +68,7 @@ private static void waitForTestResult(ServerSocketChannel ssc, boolean expectFai
6668
*/
6769
ssc.configureBlocking(false);
6870
sk = ssc.register(sel, SelectionKey.OP_ACCEPT);
69-
long to = 15*1000;
71+
long to = Utils.adjustTimeout(15*1000);
7072
sc = null;
7173
for (;;) {
7274
long st = System.currentTimeMillis();
@@ -89,7 +91,7 @@ private static void waitForTestResult(ServerSocketChannel ssc, boolean expectFai
8991
*/
9092
sc.configureBlocking(false);
9193
sk = sc.register(sel, SelectionKey.OP_READ);
92-
to = 5000;
94+
to = Utils.adjustTimeout(5000);
9395
ByteBuffer bb = ByteBuffer.allocateDirect(20);
9496
for (;;) {
9597
long st = System.currentTimeMillis();

0 commit comments

Comments
 (0)