goiri commented on a change in pull request #2406:
URL: https://github.com/apache/hadoop/pull/2406#discussion_r513133542



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCreation.java
##########
@@ -273,10 +272,17 @@ public void testServerDefaultsWithMinimalCaching()
               defaults.getDefaultStoragePolicyId());
       doReturn(newDefaults).when(spyNamesystem).getServerDefaults();
 
-      Thread.sleep(1);
-      defaults = dfsClient.getServerDefaults();
-      // Value is updated correctly
-      assertEquals(updatedDefaultBlockSize, defaults.getBlockSize());
+      // Verify that the value is updated correctly
+      GenericTestUtils.waitFor(()->{
+        try {
+          FsServerDefaults currDef = dfsClient.getServerDefaults();
+          return (currDef.getBlockSize() == updatedDefaultBlockSize);
+        } catch (IOException e) {
+          // do nothing;
+          return false;
+        }
+      }, 1, 1000);

Review comment:
       This is changed so I assume @aajisaka is fine with this.




----------------------------------------------------------------
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.

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