merlimat commented on a change in pull request #9948:
URL: https://github.com/apache/pulsar/pull/9948#discussion_r596526863



##########
File path: 
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProviderToken.java
##########
@@ -99,7 +100,8 @@
 
     @Override
     public void close() throws IOException {
-        // noop
+        expiredTokenMetrics.clear();
+        expiringTokenMinutesMetrics.clear();

Review comment:
       That seems to make the prod code to bend around the test structure. 
   
   In general, it's problematic to rely on the metrics values, precisely 
because they're static and if multiple tests are running in parallel that will 
break all assumptions anyway. 
   
   For this case, if we *really* need to reset the stats, it could instead be 
done through a static `resetStats()` methods that is package protected, instead 
of relying on the `close()`.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to