From 5321235fe8d89f01fe2c141fdef5d8186a6b20dd Mon Sep 17 00:00:00 2001 From: Inigo Goiri Date: Mon, 22 Apr 2019 13:23:42 -0700 Subject: [PATCH] HDFS-14445. TestTrySendErrorReportWhenNNThrowsIOException fails in trunk. Contributed by Ayush Saxena. --- .../apache/hadoop/hdfs/server/datanode/TestBPOfferService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBPOfferService.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBPOfferService.java index d34654edf9..2353992340 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBPOfferService.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBPOfferService.java @@ -736,7 +736,7 @@ public void testTrySendErrorReportWhenNNThrowsIOException() 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 {