ayushtkn commented on code in PR #8133:
URL: https://github.com/apache/hadoop/pull/8133#discussion_r2640470416


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/TestRouterMetrics.java:
##########
@@ -62,6 +64,19 @@ public static void init() {
     LOG.info("Test: aggregate metrics are updated correctly");
   }
 
+  @BeforeEach
+  public void setup() {
+    //reset metrics before each test
+    RouterMetrics.destroy();
+    metrics = RouterMetrics.getMetrics();
+  }
+
+  @AfterEach
+  public void tearDown() {
+    RouterMetrics.destroy();
+    metrics = RouterMetrics.getMetrics();
+  }
+
   /**

Review Comment:
   isn't just doing in BeforeEach enough?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to