cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cassandra] jasonstack commented on a change in pull request #446: CASSANDRA-15564 Refactor repair coordinator to centralize stage change logic and improved the public facing errors
Date Tue, 10 Mar 2020 08:44:20 GMT
jasonstack commented on a change in pull request #446: CASSANDRA-15564 Refactor repair coordinator
to centralize stage change logic and improved the public facing errors
URL: https://github.com/apache/cassandra/pull/446#discussion_r390131976
 
 

 ##########
 File path: test/distributed/org/apache/cassandra/distributed/mock/nodetool/InternalNodeProbe.java
 ##########
 @@ -61,7 +79,26 @@ protected void connect()
         mbeanServerConn = null;
         jmxc = null;
 
-        ssProxy = StorageService.instance;
+        if (withNotifications)
+        {
+            ssProxy = StorageService.instance;
+        }
+        else
+        {
+            // replace the notification apis with a no-op method
+            StorageServiceMBean mock = Mockito.spy(StorageService.instance);
+            Mockito.doNothing().when(mock).addNotificationListener(Mockito.any(), Mockito.any(),
Mockito.any());
+            try
+            {
+                Mockito.doNothing().when(mock).removeNotificationListener(Mockito.any(),
Mockito.any(), Mockito.any());
+                Mockito.doNothing().when(mock).removeNotificationListener(Mockito.any());
+            }
+            catch (ListenerNotFoundException e)
+            {
+                throw new AssertionError(e);
+            }
+            ssProxy = mock;
 
 Review comment:
   I don't understand what are the cases that a no-op storage-service is needed.. what happened
if we just use `StorageService.instance`?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message