changeset 52978:a7e587822a2d

8171426: java/lang/ProcessBuilder/Basic.java failed Stream closed Reviewed-by: bpb, jlaskey
author rriggs
date Tue, 04 Dec 2018 12:26:49 -0500
parents 8527b6100a59
children 106ad76acf31
files test/jdk/java/lang/ProcessBuilder/Basic.java
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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();