8305596: (fc) Two java/nio/channels tests fail after JDK-8303260

Reviewed-by: alanb
This commit is contained in:
Brian Burkhalter 2023-04-05 20:16:13 +00:00
parent 44f33ad1a9
commit 39f12a88e7
3 changed files with 10 additions and 10 deletions

View File

@ -540,10 +540,6 @@ java/net/ServerSocket/AcceptInheritHandle.java 8211854 aix-ppc6
# jdk_nio
java/nio/channels/AsyncCloseAndInterrupt.java 8305596 generic-all
java/nio/channels/FileChannel/Transfer.java 8305596 generic-all
java/nio/channels/AsynchronousSocketChannel/StressLoopback.java 8211851 aix-ppc64
java/nio/channels/DatagramChannel/ManySourcesAndTargets.java 8264385 macosx-aarch64

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, 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
@ -469,8 +469,9 @@ public class AsyncCloseAndInterrupt {
SocketChannel sc = (SocketChannel)ch;
if (!sc.socket().isOutputShutdown())
throw new RuntimeException("Output not shutdown");
} else if ((test == TEST_INTR) && (op == TRANSFER_FROM)) {
// Let this case pass -- CBIE applies to other channel
} else if ((test == TEST_INTR || test == TEST_PREINTR)
&& (op == TRANSFER_FROM)) {
// Let these cases pass -- CBIE applies to other channel
} else {
throw new RuntimeException("Channel still open");
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2023, 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
@ -95,8 +95,11 @@ public class Transfer {
bytesWritten = sinkChannel.transferFrom(sourceChannel, 1000, 10);
if (bytesWritten > 0)
throw new RuntimeException("Wrote past file size");
if (bytesWritten > 10)
throw new RuntimeException("Wrote too many bytes");
if (sinkChannel.size() != 1000 + bytesWritten)
throw new RuntimeException("Unexpected sink size");
sourceChannel.close();
sinkChannel.close();