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

ASF GitHub Bot commented on YARN-11694:
---------------------------------------

kaiyaok2 commented on PR #6793:
URL: https://github.com/apache/hadoop/pull/6793#issuecomment-2097723400

   > +1 Can we fix the checkstyle issue?
   
   @slfan1989 I fixed the 2 "line too long" issues. 
   The remaining 5 are in fact existing issues (as I changed `public static 
CountDownLatch latch = new CountDownLatch(1);` to `public static CountDownLatch 
latch;`). I don't think it's necessary to turn `latch` private and add getter 
methods, since these classes are only used in testing.




> 2 tests are non-idempotent (passes in the first run but fails in repeated 
> runs in the same JVM)
> -----------------------------------------------------------------------------------------------
>
>                 Key: YARN-11694
>                 URL: https://issues.apache.org/jira/browse/YARN-11694
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Kaiyao Ke
>            Priority: Major
>              Labels: pull-request-available
>
> ## TestTimelineReaderMetrics#testTimelineReaderMetrics
> `org.apache.hadoop.yarn.server.timelineservice.reader.TestTimelineReaderMetrics#testTimelineReaderMetrics`
>  does not perform a source unregistration after test execution, so the 
> `TimelineReaderMetrics.getInstance()` call in repeated runs will throw an 
> error since the metrics source `TimelineReaderMetrics` already exists.
> Error message in the 2nd run:
> ```
> org.apache.hadoop.metrics2.MetricsException: Metrics source 
> TimelineReaderMetrics already exists!
>  at 
> org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.newSourceName(DefaultMetricsSystem.java:152)
>  at 
> org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.sourceName(DefaultMetricsSystem.java:125)
>  at 
> org.apache.hadoop.metrics2.impl.MetricsSystemImpl.register(MetricsSystemImpl.java:229)
>  at 
> org.apache.hadoop.yarn.server.timelineservice.metrics.TimelineReaderMetrics.getInstance(TimelineReaderMetrics.java:61)
>  at 
> org.apache.hadoop.yarn.server.timelineservice.reader.TestTimelineReaderMetrics.setup(TestTimelineReaderMetrics.java:52)
>  at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>  at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
>  at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
> ```
>  
> ## TestFederationStateStoreClientMetrics#testSuccessfulCalls
> `org.apache.hadoop.yarn.server.federation.store.metrics.TestFederationStateStoreClientMetrics#testSuccessfulCalls`
>  retrieves the historical number of successful calls, but does not retrieve 
> the historical average latency of those calls. For example, it asserts  
> `FederationStateStoreClientMetrics.getLatencySucceededCalls()` is 100 after 
> the `goodStateStore.registerSubCluster(100);` call. However, in the second 
> execution of the test, 2 historical calls from the first execution (with 
> latency 100 and 200 respectively) has already been recorded, so 
> `FederationStateStoreClientMetrics.getLatencySucceededCalls()` will be 
> 133.3333 (mean of 100, 200 and 100)
>  
> Error message in the 2nd run:
> ```
> java.lang.AssertionError: expected:<100.0> but was:<133.33333333333334>
>  at org.junit.Assert.fail(Assert.java:89)
>  at org.junit.Assert.failNotEquals(Assert.java:835)
>  at org.junit.Assert.assertEquals(Assert.java:555)
>  at org.junit.Assert.assertEquals(Assert.java:685)
>  at 
> org.apache.hadoop.yarn.server.federation.store.metrics.TestFederationStateStoreClientMetrics.testSuccessfulCalls(TestFederationStateStoreClientMetrics.java:63)
>  at java.base/java.lang.reflect.Method.invoke(Method.java:568)
> ```



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to