8171426: java/lang/ProcessBuilder/Basic.java failed Stream closed
authorrriggs
Tue, 04 Dec 2018 12:26:49 -0500
changeset 52821 a7e587822a2d
parent 52820 8527b6100a59
child 52822 106ad76acf31
8171426: java/lang/ProcessBuilder/Basic.java failed Stream closed Reviewed-by: bpb, jlaskey
test/jdk/java/lang/ProcessBuilder/Basic.java
--- a/test/jdk/java/lang/ProcessBuilder/Basic.java	Tue Dec 04 17:54:13 2018 +0100
+++ b/test/jdk/java/lang/ProcessBuilder/Basic.java	Tue Dec 04 12:26:49 2018 -0500
@@ -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
@@ -2084,7 +2084,7 @@
 
         //----------------------------------------------------------------
         // Check that reads which are pending when Process.destroy is
-        // called, get EOF, not IOException("Stream closed").
+        // called, get EOF, or IOException("Stream closed").
         //----------------------------------------------------------------
         try {
             final int cases = 4;
@@ -2112,6 +2112,11 @@
                                 default: throw new Error();
                             }
                             equal(-1, r);
+                        } catch (IOException ioe) {
+                            if (!ioe.getMessage().equals("Stream closed")) {
+                                // BufferedInputStream may throw IOE("Stream closed").
+                                unexpected(ioe);
+                            }
                         } catch (Throwable t) { unexpected(t); }}};
 
                 thread.start();