File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
new-integration-tests/src/test/java/oracle/weblogic/kubernetes/utils Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -64,8 +64,13 @@ public static ExecResult exec(
64
64
Thread out = null ;
65
65
66
66
try {
67
+ String stdout = null ;
67
68
if (isRedirectToOut ) {
68
69
InputStream i = in .getInputStream ();
70
+ i .mark (0 );
71
+ // read the stdout first, and reset before we redirect the output
72
+ stdout = read (i );
73
+ i .reset ();
69
74
@ SuppressWarnings ("resource" )
70
75
CopyingOutputStream copyOut = new CopyingOutputStream (System .out );
71
76
// this makes sense because CopyingOutputStream is an InputStreamWrapper
@@ -83,7 +88,13 @@ public static ExecResult exec(
83
88
}
84
89
85
90
p .waitFor ();
86
- return new ExecResult (p .exitValue (), read (in .getInputStream ()), read (p .getErrorStream ()));
91
+
92
+ // if we have not read the stdout, we do it now
93
+ if (stdout == null ) {
94
+ stdout = read (in .getInputStream ());
95
+ }
96
+ return new ExecResult (p .exitValue (), stdout , read (p .getErrorStream ()));
97
+
87
98
} finally {
88
99
if (out != null ) {
89
100
out .join ();
You can’t perform that action at this time.
0 commit comments