HDFS-3833. TestDFSShell fails on windows due to concurrent file read/write. Contributed by Brandon Li

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1379525 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Suresh Srinivas 2012-08-31 17:43:35 +00:00
parent e5a9d672f0
commit 2fd49f5a57
2 changed files with 8 additions and 0 deletions

View File

@ -716,6 +716,9 @@ Branch-2 ( Unreleased changes )
HDFS-3432. TestDFSZKFailoverController tries to fail over too early (todd) HDFS-3432. TestDFSZKFailoverController tries to fail over too early (todd)
HDFS-3833. TestDFSShell fails on windows due to concurrent file
read/write. (Brandon Li via suresh)
Release 2.0.0-alpha - 05-23-2012 Release 2.0.0-alpha - 05-23-2012
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -1284,6 +1284,11 @@ public Object run() throws Exception {
public void testGet() throws IOException { public void testGet() throws IOException {
DFSTestUtil.setLogLevel2All(FSInputChecker.LOG); DFSTestUtil.setLogLevel2All(FSInputChecker.LOG);
final Configuration conf = new HdfsConfiguration(); final Configuration conf = new HdfsConfiguration();
// Race can happen here: block scanner is reading the file when test tries
// to corrupt the test file, which will fail the test on Windows platform.
// Disable block scanner to avoid this race.
conf.setInt(DFSConfigKeys.DFS_DATANODE_SCAN_PERIOD_HOURS_KEY, -1);
MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build(); MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
DistributedFileSystem dfs = (DistributedFileSystem)cluster.getFileSystem(); DistributedFileSystem dfs = (DistributedFileSystem)cluster.getFileSystem();