diff options
Diffstat (limited to 'bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/shell')
-rw-r--r-- | bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/shell/Shell.groovy | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/shell/Shell.groovy b/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/shell/Shell.groovy index 4df36422..fbd85e3b 100644 --- a/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/shell/Shell.groovy +++ b/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/shell/Shell.groovy @@ -83,13 +83,14 @@ class Shell { } ByteArrayOutputStream outStream = new ByteArrayOutputStream(4096) ByteArrayOutputStream errStream = new ByteArrayOutputStream(4096) - Thread.start { - proc.consumeProcessOutput(outStream, errStream) - } if (timeout >= 0) { + // WARNING: there's a potential race condition bellow + // essentially what we really need here is + // proc.waitForOrKillProcessOutput(outStream, errStream) + proc.consumeProcessOutput(outStream, errStream) proc.waitForOrKill(timeout) } else { - proc.waitFor() + proc.waitForProcessOutput(outStream, errStream) } // Possibly a bug in String.split as it generates a 1-element array on an |