[ 
https://issues.apache.org/jira/browse/HDFS-13384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16430209#comment-16430209
 ] 

Yiqun Lin commented on HDFS-13384:
----------------------------------

Some comments, all of them for the unit test:
 * The following check is no needed and there is a chance to cause the failure 
since we have done the {{simulateNNSlow(nn0)}} before.
{code:java}
final String jsonString3 = metrics.getLiveNodes();
JSONObject jsonObject3 = new JSONObject(jsonString3);
assertEquals(4, jsonObject3.names().length());
{code}

 * We can extract following waiting-checking logic as a independent method and 
reuse it in {{testNamenodeMetricsSlow}}. This will simplify the test a lot.
{code:java}
// We wait until the cached value is updated
+    GenericTestUtils.waitFor(new Supplier<Boolean>() {
+      @Override
+      public Boolean get() {
+        return !jsonString4.equals(metrics.getLiveNodes());
+      }
+    }, 500, 5 * 1000);
+
+    final String jsonString5 = metrics.getLiveNodes();
+    JSONObject jsonObject5 = new JSONObject(jsonString5);
+    assertEquals(0, jsonObject5.length());
{code}

> RBF: Improve timeout RPC call mechanism
> ---------------------------------------
>
>                 Key: HDFS-13384
>                 URL: https://issues.apache.org/jira/browse/HDFS-13384
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Íñigo Goiri
>            Assignee: Íñigo Goiri
>            Priority: Minor
>         Attachments: HDFS-13384.000.patch, HDFS-13384.001.patch, 
> HDFS-13384.002.patch, HDFS-13384.003.patch
>
>
> When issuing RPC requests to subclusters, we have a time out mechanism 
> introduced in HDFS-12273. We need to improve this is handled.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to