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

Vinayakumar B commented on HDFS-9067:
-------------------------------------

{code} 
-  protected void waitForMetric(final String metricName, final int 
expectedValue)
-      throws TimeoutException, InterruptedException {
-    GenericTestUtils.waitFor(new Supplier<Boolean>() {
-      @Override
-      public Boolean get() {
-        try {
-          final int currentValue = Integer.parseInt(jmx.getValue(metricName));
-          LOG.info("Waiting for " + metricName +
-                       " to reach value " + expectedValue +
-                       ", current value = " + currentValue);
-          return currentValue == expectedValue;
-        } catch (Exception e) {
-          throw new UnhandledException("Test failed due to unexpected 
exception", e);
-        }
-      }
-    }, 1000, Integer.MAX_VALUE);
-  }
-{code}
I think instead of above complete removal of method, you can call 
{{DFSTestUtil#waitforMetric(..)}} from here, so that changes in other files 
need not be required.

> o.a.h.hdfs.server.datanode.fsdataset.impl.TestLazyWriter is failing in trunk
> ----------------------------------------------------------------------------
>
>                 Key: HDFS-9067
>                 URL: https://issues.apache.org/jira/browse/HDFS-9067
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Haohui Mai
>            Assignee: Surendra Singh Lilhore
>            Priority: Critical
>         Attachments: HDFS-9067-001.patch, HDFS-9067-002.patch, HDFS-9067.patch
>
>
> The test TestLazyWriter is consistently failing in trunk. For example:
> https://builds.apache.org/job/PreCommit-HDFS-Build/12407/testReport/



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to