This is an automated email from the ASF dual-hosted git repository.
exceptionfactory pushed a commit to branch support/nifi-1.x
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/support/nifi-1.x by this push:
new 0ee43773f4 NIFI-11746 Fixed
FlowSynchronizationIT.testComponentsRecreatedOnRestart()
0ee43773f4 is described below
commit 0ee43773f4eed37a7bb3b491d98fe309b7f79c64
Author: Mark Payne <[email protected]>
AuthorDate: Mon Jul 10 11:02:21 2023 -0400
NIFI-11746 Fixed FlowSynchronizationIT.testComponentsRecreatedOnRestart()
- Ensure that testComponentsRecreatedOnRestart only counts components in
its own group
This closes #7466
Signed-off-by: David Handermann <[email protected]>
(cherry picked from commit 96be7377b3f678271f13a9085d63e223670ca522)
---
.../nifi/tests/system/clustering/FlowSynchronizationIT.java | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git
a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/FlowSynchronizationIT.java
b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/FlowSynchronizationIT.java
index 6cb2df4843..65fcfd02c0 100644
---
a/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/FlowSynchronizationIT.java
+++
b/nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/clustering/FlowSynchronizationIT.java
@@ -30,7 +30,6 @@ import org.apache.nifi.tests.system.NiFiInstanceFactory;
import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.toolkit.cli.impl.client.nifi.ProcessorClient;
-import org.apache.nifi.toolkit.cli.impl.client.nifi.RequestConfig;
import org.apache.nifi.web.api.dto.ControllerServiceDTO;
import org.apache.nifi.web.api.dto.NodeDTO;
import org.apache.nifi.web.api.dto.PortDTO;
@@ -73,7 +72,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class FlowSynchronizationIT extends NiFiSystemIT {
private static final Logger logger =
LoggerFactory.getLogger(FlowSynchronizationIT.class);
- private static final RequestConfig DO_NOT_REPLICATE = () ->
Collections.singletonMap("X-Request-Replicated", "value");
private static final String RUNNING_STATE = "RUNNING";
private static final String ENABLED_STATE = "ENABLED";
private static final String SENSITIVE_VALUE_MASK = "********";
@@ -577,12 +575,13 @@ public class FlowSynchronizationIT extends NiFiSystemIT {
@Test
public void testComponentsRecreatedOnRestart() throws NiFiClientException,
IOException, InterruptedException {
// Build dataflow with processors at root level and an inner group
that contains an input port, output port, and a processor, as well as a
Controller Service that the processor will use.
- final ProcessorEntity generate =
getClientUtil().createProcessor("GenerateFlowFile");
- final ProcessGroupEntity group =
getClientUtil().createProcessGroup("Inner Group", "root");
+ final ProcessGroupEntity topLevelGroup =
getClientUtil().createProcessGroup("testComponentsRecreatedOnRestart", "root");
+ final ProcessorEntity generate =
getClientUtil().createProcessor("GenerateFlowFile", topLevelGroup.getId());
+ final ProcessGroupEntity group =
getClientUtil().createProcessGroup("Inner Group", topLevelGroup.getId());
final PortEntity inPort = getClientUtil().createInputPort("In",
group.getId());
final PortEntity outPort = getClientUtil().createOutputPort("Out",
group.getId());
final ProcessorEntity count =
getClientUtil().createProcessor("CountFlowFiles", group.getId());
- final ProcessorEntity terminate =
getClientUtil().createProcessor("TerminateFlowFile");
+ final ProcessorEntity terminate =
getClientUtil().createProcessor("TerminateFlowFile", topLevelGroup.getId());
getClientUtil().updateProcessorSchedulingPeriod(generate, "60 sec");
final ControllerServiceEntity countService =
getClientUtil().createControllerService("StandardCountService", group.getId());
@@ -622,7 +621,7 @@ public class FlowSynchronizationIT extends NiFiSystemIT {
// is on Node 2.
switchClientToNode(2);
- final ProcessGroupFlowEntity flow =
getNifiClient().getFlowClient(DO_NOT_REPLICATE).getProcessGroup("root");
+ final ProcessGroupFlowEntity flow =
getNifiClient().getFlowClient(DO_NOT_REPLICATE).getProcessGroup(topLevelGroup.getId());
final FlowDTO flowDto = flow.getProcessGroupFlow().getFlow();
assertEquals(2, flowDto.getConnections().size());
assertEquals(2, flowDto.getProcessors().size());