On Wed, Aug 28, 2013 at 6:30 PM, Jay Vyas <jayunit...@gmail.com> wrote:
> Hi bigtop ! Im finding that a complex shell script, run via Shell.groovy,
> hangs when i call it.
>
> Ive foud that the script fails after "PROCES :::::::: READ LINES" below, in
> the debugging statement.
>
> This is a shell script which starts a flume sink up using nohup, and then
> cat's to a file that the sink is listening on.   The script completes
> normally when run from anywhere in the terminal.

Could you possibly attach a script?

> Any thoughts on why the ITest Shell would hang ?

I'm surprised it fails that way, since there's quite a big of existing scripts
that get pumped through it. To get you unstuck, though, you can
try to do what I've done in the attached diff and see if that makes
any difference.

Thanks,
Roman.
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 ae3da68..45de222 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
@@ -79,17 +79,13 @@ class Shell {
       writer.close()
     }
     ByteArrayOutputStream baosErr = new ByteArrayOutputStream(4096);
-    proc.consumeProcessErrorStream(baosErr);
-    out = proc.in.readLines()
+    ByteArrayOutputStream baosOut = new ByteArrayOutputStream(4096);
+    proc.consumeProcessErrorStream(baosOut, baosErr);
 
     // Possibly a bug in String.split as it generates a 1-element array on an
     // empty String
-    if (baosErr.size() != 0) {
-      err = baosErr.toString().split('\n');
-    }
-    else {
-      err = new ArrayList<String>();
-    }
+    err = baosErr.size() != 0 ? baosErr.toString().split('\n') : new 
ArrayList<String>();
+    out = baosOut.size() != 0 ? baosOut.toString().split('\n') : new 
ArrayList<String>();
 
     proc.waitFor()
     ret = proc.exitValue()

Reply via email to