You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by cu...@apache.org on 2007/07/24 16:56:51 UTC
svn commit: r559068 - in /lucene/hadoop/trunk: CHANGES.txt
src/test/org/apache/hadoop/dfs/TestDecommission.java
Author: cutting
Date: Tue Jul 24 07:56:50 2007
New Revision: 559068
URL: http://svn.apache.org/viewvc?view=rev&rev=559068
Log:
HADOOP-1640. Fix TestDecommission on Windows. Contributed by Dhruba.
Modified:
lucene/hadoop/trunk/CHANGES.txt
lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDecommission.java
Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=559068&r1=559067&r2=559068
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Tue Jul 24 07:56:50 2007
@@ -407,6 +407,9 @@
135. HADOOP-1619. Fix FSInputChecker to not attempt to read past EOF.
(Hairong Kuang via cutting)
+136. HADOOP-1640. Fix TestDecommission on Windows.
+ (Dhruba Borthakur via cutting)
+
Release 0.13.0 - 2007-06-08
Modified: lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDecommission.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDecommission.java?view=diff&rev=559068&r1=559067&r2=559068
==============================================================================
--- lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDecommission.java (original)
+++ lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDecommission.java Tue Jul 24 07:56:50 2007
@@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.net.*;
+import java.lang.InterruptedException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
@@ -83,10 +84,19 @@
private void checkFile(FileSystem fileSys, Path name, int repl)
throws IOException {
- String[][] locations = fileSys.getFileCacheHints(name, 0, fileSize);
- for (int idx = 0; idx < locations.length; idx++) {
- assertEquals("Number of replicas for block" + idx,
- Math.min(numDatanodes, repl), locations[idx].length);
+ boolean done = false;
+ while (!done) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {}
+ done = true;
+ String[][] locations = fileSys.getFileCacheHints(name, 0, fileSize);
+ for (int idx = 0; idx < locations.length; idx++) {
+ if (locations[idx].length < repl) {
+ done = false;
+ break;
+ }
+ }
}
}