HADOOP-12714. Fix hadoop-mapreduce-client-nativetask unit test which fails because it is not able to open the "glibc bug spill" file. (cmccabe)

This commit is contained in:
Colin Patrick Mccabe 2016-01-15 13:53:05 -08:00
parent b2c155f810
commit 5af5f9575a
3 changed files with 13 additions and 0 deletions

View File

@ -691,6 +691,9 @@ Release 2.9.0 - UNRELEASED
HADOOP-12712. Fix some cmake plugin and native build warnings (cmccabe)
HADOOP-12714. Fix hadoop-mapreduce-client-nativetask unit test which fails
because it is not able to open the "glibc bug spill" file. (cmccabe)
Release 2.8.0 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -209,6 +209,7 @@
<goals><goal>cmake-test</goal></goals>
<configuration>
<testName>test-native-task</testName>
<workingDirectory>${project.build.directory}/native/test</workingDirectory>
<source>${basedir}/src</source>
<binary>${project.build.directory}/native/test/nttest</binary>
<args><arg>--gtest_filter=-Perf.</arg></args>

View File

@ -77,6 +77,12 @@ public class TestMojo extends AbstractMojo {
@Parameter(defaultValue="600")
private int timeout;
/**
* The working directory to use.
*/
@Parameter
private File workingDirectory;
/**
* Path to results directory.
*/
@ -307,6 +313,9 @@ public void execute() throws MojoExecutionException {
getLog().info(bld.toString());
ProcessBuilder pb = new ProcessBuilder(cmd);
Exec.addEnvironment(pb, env);
if (workingDirectory != null) {
pb.directory(workingDirectory);
}
pb.redirectError(new File(results, testName + ".stderr"));
pb.redirectOutput(new File(results, testName + ".stdout"));
getLog().info("with extra environment variables " + Exec.envToString(env));