markap14 commented on code in PR #7661:
URL: https://github.com/apache/nifi/pull/7661#discussion_r1340487721


##########
nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/JoinClusterWithDifferentFlow.java:
##########
@@ -106,100 +95,57 @@ public void testStartupWithDifferentFlow() throws 
IOException, NiFiClientExcepti
         node2.stop();
 
         final File node2ConfDir = new File(node2.getInstanceDirectory(), 
"conf");
-        final File flowXmlFile = new File(node2ConfDir, "flow.xml.gz");
-        Files.deleteIfExists(flowXmlFile.toPath());
-        
Files.copy(Paths.get("src/test/resources/flows/mismatched-flows/flow2.xml.gz"), 
flowXmlFile.toPath());
+        final File flowJsonFile = new File(node2ConfDir, "flow.json.gz");
+        Files.deleteIfExists(flowJsonFile.toPath());
+        
Files.copy(Paths.get("src/test/resources/flows/mismatched-flows/flow2.json.gz"),
 flowJsonFile.toPath());
 
         node2.start(true);
 
-        final File backupFile = getBackupFile(node2ConfDir);
-        final NodeDTO node2Dto = getNodeDtoByApiPort(5672);
+        while 
(getNifiClient().getControllerClient().getNodes().getCluster().getNodes().stream().filter(n
 -> n.getStatus().equals("CONNECTED")).count() != 2) {
+            Thread.sleep(3000);
+        }
 
+        final File backupFile = getBackupFile(node2ConfDir);
         verifyFlowContentsOnDisk(backupFile);
-        disconnectNode(node2Dto);
         verifyInMemoryFlowContents();
-
-        // Reconnect the node so that we can properly shutdown
-        reconnectNode(node2Dto);

Review Comment:
   Is there a reason that we're changing the logic here?
   Previously, the idea was to disconnect Node 2 so that any request made to 
the node would be a response directly from that node rather than a cluster 
response; then issue the request to Node 2 and verify that its flow is correct. 
Then, it would reconnect the node so that the shutdown logic would complete 
successfully.
   
   The logic here has now changed to "verify that the cluster's flow is 
correct", which is not the same as "verify that Node 2's flow is correct."
   
   That said, there is now a better way to handle this, by doing something like:
   ```
   switchClientToNode(2);
   getNifiClient().getFlowClient(DO_NOT_REPLICATE)...
   ```
   This way, we don't have to disconnect the node, but we can issue requests 
directly to that node. But I think we need to either restore the logic or use 
the DO_NOT_REPLICATE to ensure that we're verifying Node 2's flow.



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

Reply via email to