Debug sparkRTest

This commit is contained in:
Lee moon soo 2016-07-18 03:28:43 +09:00
parent 31369c6e65
commit a208cd0b3a
2 changed files with 20 additions and 0 deletions

View file

@ -26,6 +26,9 @@ import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.PumpStreamHandler;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethodBase;
import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
@ -415,6 +418,22 @@ public abstract class AbstractTestRestApi {
};
}
public static void ps() {
DefaultExecutor executor = new DefaultExecutor();
executor.setStreamHandler(new PumpStreamHandler(System.out, System.err));
CommandLine cmd = CommandLine.parse("ps");
cmd.addArgument("aux", false);
try {
executor.execute(cmd);
} catch (IOException e) {
LOG.error(e.getMessage(), e);
}
}
/** Status code matcher */
protected Matcher<? super HttpMethodBase> isForbiden() { return responsesWith(403); }

View file

@ -98,6 +98,7 @@ public class ZeppelinSparkClusterTest extends AbstractTestRestApi {
"df <- createDataFrame(sqlContext, localDF)\n" +
"count(df)"
);
ps();
note.run(p.getId());
waitForFinish(p);
System.err.println("sparkRTest=" + p.getResult().message());