You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/04/27 15:54:44 UTC

[GitHub] [shardingsphere] terrymanu commented on a diff in pull request #17127: Add unit test for ClusterContextManagerCoordinator.completeUnitShowProcessList(final ShowProcessListUnitCompleteEvent event)

terrymanu commented on code in PR #17127:
URL: https://github.com/apache/shardingsphere/pull/17127#discussion_r859966501


##########
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java:
##########
@@ -351,6 +356,39 @@ public void assertRenewInstanceOnlineEvent() {
         assertThat(((LinkedList<ComputeNodeInstance>) contextManager.getInstanceContext().getComputeNodeInstances()).get(1).getInstanceDefinition(), is(instanceDefinition1));
     }
     
+    @Test
+    public void assertCompleteUnitShowProcessList() {
+        final String showProcessListId = "show_process_list_id_1";
+        final ShowProcessListSimpleLock simpleLock = new ShowProcessListSimpleLock();
+        ShowProcessListManager.getInstance().getLocks().put(showProcessListId, simpleLock);
+        

Review Comment:
   Please remove unnecessary blank line



##########
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java:
##########
@@ -351,6 +356,39 @@ public void assertRenewInstanceOnlineEvent() {
         assertThat(((LinkedList<ComputeNodeInstance>) contextManager.getInstanceContext().getComputeNodeInstances()).get(1).getInstanceDefinition(), is(instanceDefinition1));
     }
     
+    @Test
+    public void assertCompleteUnitShowProcessList() {
+        final String showProcessListId = "show_process_list_id_1";
+        final ShowProcessListSimpleLock simpleLock = new ShowProcessListSimpleLock();
+        ShowProcessListManager.getInstance().getLocks().put(showProcessListId, simpleLock);
+        

Review Comment:
   Please remove unnecessary blank line



##########
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java:
##########
@@ -351,6 +356,39 @@ public void assertRenewInstanceOnlineEvent() {
         assertThat(((LinkedList<ComputeNodeInstance>) contextManager.getInstanceContext().getComputeNodeInstances()).get(1).getInstanceDefinition(), is(instanceDefinition1));
     }
     
+    @Test
+    public void assertCompleteUnitShowProcessList() {
+        final String showProcessListId = "show_process_list_id_1";

Review Comment:
   What is the mean of `show_process_list_id_1`,  how about change it to `foo_process_id`?



##########
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java:
##########
@@ -351,6 +356,39 @@ public void assertRenewInstanceOnlineEvent() {
         assertThat(((LinkedList<ComputeNodeInstance>) contextManager.getInstanceContext().getComputeNodeInstances()).get(1).getInstanceDefinition(), is(instanceDefinition1));
     }
     
+    @Test
+    public void assertCompleteUnitShowProcessList() {
+        final String showProcessListId = "show_process_list_id_1";
+        final ShowProcessListSimpleLock simpleLock = new ShowProcessListSimpleLock();

Review Comment:
   Please remove unnecessary `final`



##########
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java:
##########
@@ -351,6 +356,39 @@ public void assertRenewInstanceOnlineEvent() {
         assertThat(((LinkedList<ComputeNodeInstance>) contextManager.getInstanceContext().getComputeNodeInstances()).get(1).getInstanceDefinition(), is(instanceDefinition1));
     }
     
+    @Test
+    public void assertCompleteUnitShowProcessList() {
+        final String showProcessListId = "show_process_list_id_1";
+        final ShowProcessListSimpleLock simpleLock = new ShowProcessListSimpleLock();

Review Comment:
   Please remove unnecessary `final`



##########
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java:
##########
@@ -351,6 +356,39 @@ public void assertRenewInstanceOnlineEvent() {
         assertThat(((LinkedList<ComputeNodeInstance>) contextManager.getInstanceContext().getComputeNodeInstances()).get(1).getInstanceDefinition(), is(instanceDefinition1));
     }
     
+    @Test
+    public void assertCompleteUnitShowProcessList() {
+        final String showProcessListId = "show_process_list_id_1";

Review Comment:
   What is the mean of `show_process_list_id_1`,  how about change it to `foo_process_list_id`?



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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