Skip to content

Commit 39f12a8

Browse files
author
Brian Burkhalter
committedApr 5, 2023
8305596: (fc) Two java/nio/channels tests fail after JDK-8303260
Reviewed-by: alanb
1 parent 44f33ad commit 39f12a8

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed
 

‎test/jdk/ProblemList.txt

-4
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,6 @@ java/net/ServerSocket/AcceptInheritHandle.java 8211854 aix-ppc6
540540

541541
# jdk_nio
542542

543-
java/nio/channels/AsyncCloseAndInterrupt.java 8305596 generic-all
544-
545-
java/nio/channels/FileChannel/Transfer.java 8305596 generic-all
546-
547543
java/nio/channels/AsynchronousSocketChannel/StressLoopback.java 8211851 aix-ppc64
548544

549545
java/nio/channels/DatagramChannel/ManySourcesAndTargets.java 8264385 macosx-aarch64

‎test/jdk/java/nio/channels/AsyncCloseAndInterrupt.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2023, 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
@@ -469,8 +469,9 @@ private void caught(Channel ch, IOException x) {
469469
SocketChannel sc = (SocketChannel)ch;
470470
if (!sc.socket().isOutputShutdown())
471471
throw new RuntimeException("Output not shutdown");
472-
} else if ((test == TEST_INTR) && (op == TRANSFER_FROM)) {
473-
// Let this case pass -- CBIE applies to other channel
472+
} else if ((test == TEST_INTR || test == TEST_PREINTR)
473+
&& (op == TRANSFER_FROM)) {
474+
// Let these cases pass -- CBIE applies to other channel
474475
} else {
475476
throw new RuntimeException("Channel still open");
476477
}

‎test/jdk/java/nio/channels/FileChannel/Transfer.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2023, 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
@@ -95,8 +95,11 @@ public void testFileChannel() throws Exception {
9595

9696
bytesWritten = sinkChannel.transferFrom(sourceChannel, 1000, 10);
9797

98-
if (bytesWritten > 0)
99-
throw new RuntimeException("Wrote past file size");
98+
if (bytesWritten > 10)
99+
throw new RuntimeException("Wrote too many bytes");
100+
101+
if (sinkChannel.size() != 1000 + bytesWritten)
102+
throw new RuntimeException("Unexpected sink size");
100103

101104
sourceChannel.close();
102105
sinkChannel.close();

0 commit comments

Comments
 (0)