8213235: java/nio/channels/SocketChannel/AsyncCloseChannel.java fails with threads that didn't exit
Reviewed-by: alanb, dfuchs
--- a/test/jdk/java/nio/channels/SocketChannel/AsyncCloseChannel.java Wed Nov 21 15:09:27 2018 +0000
+++ b/test/jdk/java/nio/channels/SocketChannel/AsyncCloseChannel.java Wed Nov 21 08:16:25 2018 -0800
@@ -24,7 +24,6 @@
/* @test
* @bug 6285901 6501089
* @summary Check no data is written to wrong socket channel during async closing.
- * @run main/othervm AsyncCloseChannel
*/
import java.io.IOException;
@@ -112,7 +111,7 @@
public void run() {
boolean empty = true;
try {
- for(;;) {
+ while (keepGoing) {
int c = s.getInputStream().read();
if(c == -1) {
if(!empty)