xkrogen commented on code in PR #4871: URL: https://github.com/apache/hadoop/pull/4871#discussion_r971234834
########## hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/metrics/RpcMetrics.java: ########## @@ -344,6 +353,15 @@ public long getRpcSlowCalls() { return rpcSlowCalls.value(); } + /** + * Returns the number of requeue calls; Review Comment: Checkstyle complains: ``` ./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/metrics/RpcMetrics.java:192: /**: First sentence should end with a period. [JavadocStyle] ``` Can you change the semicolon to a period? `; -> .` ########## hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestObserverNode.java: ########## @@ -156,14 +155,17 @@ public void testObserverRequeue() throws Exception { assertSentTo(2); return fileStatus; }, 0, TimeUnit.SECONDS); - Thread.sleep(1000); - observerEditlogTailer.doTailEdits(); - FileStatus fileStatus = scheduledFuture.get(1000, TimeUnit.MILLISECONDS); + + GenericTestUtils.waitFor(() -> obRpcMetrics.getRpcRequeueCalls() > oldRequeueNum, + 50, 10000); + + observerFsNS.getEditLogTailer().doTailEdits(); + FileStatus fileStatus = scheduledFuture.get(10000, TimeUnit.MILLISECONDS); assertNotNull(fileStatus); - assertTrue(obRpcMetrics.getRpcRequeueCalls() > oldRequeueNum); - dfsCluster.getNameNode(2).getNamesystem() - .startNewEditLogTailer(dfsCluster.getConfiguration(2)); + EditLogTailer editLogTailer = new EditLogTailer(observerFsNS, conf); + observerFsNS.setEditLogTailerForTests(editLogTailer); + editLogTailer.start(); Review Comment: Just realized we should do this in a try-finally since we are trying to clean up our modifications for other tests, e.g. right now if the `waitFor()` call fails then we won't reset the `editLogTailer` and other tests may fail as a result -- 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: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org