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


##########
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);
     }
 
-
-    private List<File> getFlowXmlFiles(final File confDir) {
-        final File[] flowXmlFileArray = confDir.listFiles(file -> 
file.getName().startsWith("flow") && file.getName().endsWith(".xml.gz"));
-        final List<File> flowXmlFiles = new 
ArrayList<>(Arrays.asList(flowXmlFileArray));
-        return flowXmlFiles;
+    private List<File> getFlowJsonFiles(final File confDir) {
+        final File[] flowJsonFileArray = confDir.listFiles(file -> 
file.getName().startsWith("flow") && file.getName().endsWith(".json.gz"));
+        final List<File> flowJsonFiles = new 
ArrayList<>(Arrays.asList(flowJsonFileArray));
+        return flowJsonFiles;
     }
 
     private File getBackupFile(final File confDir) throws InterruptedException 
{
-        waitFor(() -> getFlowXmlFiles(confDir).size() == 2);
-
-        final List<File> flowXmlFiles = getFlowXmlFiles(confDir);
-        assertEquals(2, flowXmlFiles.size());
-
-        flowXmlFiles.removeIf(file -> file.getName().equals("flow.xml.gz"));
+        waitFor(() -> getFlowJsonFiles(confDir).size() == 1);
 
+        final List<File> flowXmlFiles = getFlowJsonFiles(confDir);

Review Comment:
   Variable name should have been `flowJsonFiles`



-- 
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: issues-unsubscr...@nifi.apache.org

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

Reply via email to