virajjasani commented on a change in pull request #3429:
URL: https://github.com/apache/hadoop/pull/3429#discussion_r709800511



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/mover/TestMover.java
##########
@@ -958,13 +957,29 @@ public void testMoverWithStripedFile() throws Exception {
           new String[] { "-p", barDir });
       Assert.assertEquals("Movement to ARCHIVE should be successful", 0, rc);
 
-      // verify storage types and locations
-      locatedBlocks = client.getBlockLocations(fooFile, 0, fileLen);
-      for(LocatedBlock lb : locatedBlocks.getLocatedBlocks()){
-        for( StorageType type : lb.getStorageTypes()){
-          Assert.assertEquals(StorageType.ARCHIVE, type);
+      // Verify storage types and locations.
+      // Wait until Namenode confirms ARCHIVE storage type for all blocks of
+      // fooFile.
+      GenericTestUtils.waitFor(() -> {
+        LocatedBlocks blocks;
+        try {
+          blocks = client.getBlockLocations(fooFile, 0, fileLen);
+        } catch (IOException e) {
+          throw new RuntimeException(e);
         }
-      }
+        for (LocatedBlock lb : blocks.getLocatedBlocks()) {
+          for (StorageType type : lb.getStorageTypes()) {
+            if (!StorageType.ARCHIVE.equals(type)) {
+              LOG.info("Block {} has unexpected StorageType: {}",

Review comment:
       Thanks @jojochuang. It makes sense, let me update.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to