Skip to content

Commit

Permalink
HADOOP-12589. Fix intermittent test failure of TestCopyPreserveFlag (…
Browse files Browse the repository at this point in the history
…iwasakims)
  • Loading branch information
iwasakims committed Feb 13, 2016
1 parent 91a96ea commit 36ba5ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions hadoop-common-project/hadoop-common/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2554,6 +2554,9 @@ Release 2.6.5 - UNRELEASED
HADOOP-12773. HBase classes fail to load with client/job classloader
enabled (sjlee)

HADOOP-12589. Fix intermittent test failure of TestCopyPreserveFlag
(iwasakims)

Release 2.6.4 - UNRELEASED

INCOMPATIBLE CHANGES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FileSystemTestHelper;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.contract.AbstractFSContract;
import org.apache.hadoop.fs.contract.ContractOptions;
Expand All @@ -39,9 +40,8 @@
public class LocalFSContract extends AbstractFSContract {

public static final String CONTRACT_XML = "contract/localfs.xml";
public static final String SYSPROP_TEST_BUILD_DATA = "test.build.data";
public static final String DEFAULT_TEST_BUILD_DATA_DIR = "test/build/data";
private FileSystem fs;
private String testDataDir = new FileSystemTestHelper().getTestRootDir();

public LocalFSContract(Configuration conf) {
super(conf);
Expand Down Expand Up @@ -111,6 +111,6 @@ public Path getTestPath() {
* @return the directory for test data
*/
protected String getTestDataDir() {
return System.getProperty(SYSPROP_TEST_BUILD_DATA, DEFAULT_TEST_BUILD_DATA_DIR);
return testDataDir;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FileSystemTestHelper;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsAction;
Expand Down Expand Up @@ -59,9 +60,7 @@ public void initialize() throws Exception {
conf = new Configuration(false);
conf.set("fs.file.impl", LocalFileSystem.class.getName());
fs = FileSystem.getLocal(conf);
testDir = new Path(
System.getProperty("test.build.data", "build/test/data") + "/testStat"
);
testDir = new FileSystemTestHelper().getTestRootPath(fs);
// don't want scheme on the path, just an absolute path
testDir = new Path(fs.makeQualified(testDir).toUri().getPath());

Expand Down

0 comments on commit 36ba5ca

Please sign in to comment.