浏览代码

HDFS-14445. TestTrySendErrorReportWhenNNThrowsIOException fails in trunk. Contributed by Ayush Saxena.

Inigo Goiri 6 年之前
父节点
当前提交
5321235fe8

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBPOfferService.java

@@ -736,7 +736,7 @@ public class TestBPOfferService {
           Mockito.anyInt(), Mockito.anyString());
       String errorString = "Can't send invalid block " + FAKE_BLOCK;
       bpos.trySendErrorReport(DatanodeProtocol.INVALID_BLOCK, errorString);
-      Thread.sleep(10000);
+      GenericTestUtils.waitFor(() -> secondCallTime != 0, 100, 20000);
       assertTrue("Active namenode didn't add the report back to the queue "
           + "when errorReport threw IOException", secondCallTime != 0);
     } finally {