You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ab...@apache.org on 2020/07/07 12:35:38 UTC

[nifi-minifi-cpp] branch master updated (189b1bd -> 589db71)

This is an automated email from the ASF dual-hosted git repository.

aboda pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git.


    from 189b1bd  MINIFICPP-1280 - StringUtils::replaceAll hangs in case from_string is empty
     new 1e5e3ae  MINIFICPP-1274 - Commit delete operation before shutdown
     new ff785ce  MINIFICPP-1273 - Drain connections on flow shutdown
     new 589db71  MINIFICPP-1276 - CAPITests should clean up the temporary files it creates

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CMakeLists.txt                                     |   2 +
 extensions/rocksdb-repos/FlowFileRepository.cpp    |   1 +
 libminifi/include/Connection.h                     |   2 +-
 libminifi/include/core/ProcessGroup.h              |   2 +
 libminifi/include/core/Repository.h                |   2 +-
 libminifi/src/Connection.cpp                       |  10 +-
 libminifi/src/FlowController.cpp                   |   5 +-
 libminifi/src/core/ProcessGroup.cpp                |  19 +++-
 .../test/flow-tests}/CMakeLists.txt                |  19 ++--
 libminifi/test/flow-tests/FlowControllerTests.cpp  | 125 +++++++++++++++++++++
 libminifi/test/rocksdb-tests/RepoTests.cpp         |  81 +++++++++++++
 nanofi/include/api/nanofi.h                        |   6 +-
 nanofi/src/api/nanofi.cpp                          |   4 +-
 nanofi/tests/CAPITests.cpp                         |  14 +--
 14 files changed, 254 insertions(+), 38 deletions(-)
 copy {extensions/librdkafka/tests => libminifi/test/flow-tests}/CMakeLists.txt (63%)
 create mode 100644 libminifi/test/flow-tests/FlowControllerTests.cpp


[nifi-minifi-cpp] 03/03: MINIFICPP-1276 - CAPITests should clean up the temporary files it creates

Posted by ab...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aboda pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 589db71624b7f90f27e80fe3aa40e056a22c6374
Author: Adam Markovics <ad...@aimotive.com>
AuthorDate: Mon Jul 6 11:08:34 2020 +0200

    MINIFICPP-1276 - CAPITests should clean up the temporary files it creates
    
    Signed-off-by: Arpad Boda <ab...@apache.org>
    
    This closes #830
---
 nanofi/include/api/nanofi.h |  6 +++++-
 nanofi/src/api/nanofi.cpp   |  4 ++--
 nanofi/tests/CAPITests.cpp  | 14 +++-----------
 3 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/nanofi/include/api/nanofi.h b/nanofi/include/api/nanofi.h
index f401073..bec0f83 100644
--- a/nanofi/include/api/nanofi.h
+++ b/nanofi/include/api/nanofi.h
@@ -68,13 +68,17 @@ void set_terminate_callback(void (*terminate_callback)());
  * ##################################################################
  */
 
+nifi_instance *create_instance_repo(const char *url, nifi_port *port, const char* const repo_type);
+
 /**
  * Creates a new MiNiFi instance
  * @param url remote URL the instance connects to
  * @param port remote port the instance connects to
  * @return pointer to the new instance
  **/
-nifi_instance *create_instance(const char *url, nifi_port *port);
+static nifi_instance *create_instance(const char *url, nifi_port *port){
+  return create_instance_repo(url, port, "filesystemrepository");
+}
 
 /**
  * Initialize remote connection of instance for transfers
diff --git a/nanofi/src/api/nanofi.cpp b/nanofi/src/api/nanofi.cpp
index 29944bb..616398c 100644
--- a/nanofi/src/api/nanofi.cpp
+++ b/nanofi/src/api/nanofi.cpp
@@ -108,7 +108,7 @@ class DirectoryConfiguration {
  * @Deprecated for API version 0.2 in favor of the following prototype
  * nifi_instance *create_instance(nifi_port const *port) {
  */
-nifi_instance *create_instance(const char *url, nifi_port *port) {
+nifi_instance *create_instance_repo(const char *url, nifi_port *port, const char* const repo_type) {
   // make sure that we have a thread safe way of initializing the content directory
   DirectoryConfiguration::initialize();
 
@@ -118,7 +118,7 @@ nifi_instance *create_instance(const char *url, nifi_port *port) {
    * This API will gradually move away from C++, hence malloc is used for nifi_instance
    * Since minifi::Instance is currently being used, then we need to use new in that case.
    */
-  instance->instance_ptr = new minifi::Instance(url, port->port_id, "filesystemrepository");
+  instance->instance_ptr = new minifi::Instance(url, port->port_id, repo_type);
 
   NULL_CHECK(nullptr, instance->instance_ptr);
 
diff --git a/nanofi/tests/CAPITests.cpp b/nanofi/tests/CAPITests.cpp
index 4112155..b130c16 100644
--- a/nanofi/tests/CAPITests.cpp
+++ b/nanofi/tests/CAPITests.cpp
@@ -15,29 +15,21 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <sys/stat.h>
 #include <utility>
-#include <memory>
 #include <string>
-#include <vector>
-#include <set>
 #include <fstream>
-
 #include "utils/file/FileUtils.h"
 #include "TestBase.h"
-
-#include <chrono>
-#include <thread>
 #include "api/nanofi.h"
 
-std::string test_file_content = "C API raNdOMcaSe test d4t4 th1s is!";
-std::string test_file_name = "tstFile.ext";
+const std::string test_file_content = "C API raNdOMcaSe test d4t4 th1s is!";
+const std::string test_file_name = "tstFile.ext";
 
 static nifi_instance *create_instance_obj(const char *name = "random_instance") {
   nifi_port port;
   char port_str[] = "12345";
   port.port_id = port_str;
-  return create_instance("random_instance", &port);
+  return create_instance_repo("random_instance", &port, "volatilerepository");
 }
 
 static int failure_count = 0;


[nifi-minifi-cpp] 01/03: MINIFICPP-1274 - Commit delete operation before shutdown

Posted by ab...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aboda pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 1e5e3ae8e006e64dff81096c4cf558b452fd3d1b
Author: Adam Debreceni <ad...@protonmail.com>
AuthorDate: Mon Jun 29 14:51:08 2020 +0200

    MINIFICPP-1274 - Commit delete operation before shutdown
    
    Signed-off-by: Arpad Boda <ab...@apache.org>
    
    This closes #826
---
 extensions/rocksdb-repos/FlowFileRepository.cpp |  1 +
 libminifi/include/core/Repository.h             |  2 +-
 libminifi/test/rocksdb-tests/RepoTests.cpp      | 81 +++++++++++++++++++++++++
 3 files changed, 83 insertions(+), 1 deletion(-)

diff --git a/extensions/rocksdb-repos/FlowFileRepository.cpp b/extensions/rocksdb-repos/FlowFileRepository.cpp
index 428db97..127ce9b 100644
--- a/extensions/rocksdb-repos/FlowFileRepository.cpp
+++ b/extensions/rocksdb-repos/FlowFileRepository.cpp
@@ -119,6 +119,7 @@ void FlowFileRepository::run() {
       last = now;
     }
   }
+  flush();
 }
 
 void FlowFileRepository::prune_stored_flowfiles() {
diff --git a/libminifi/include/core/Repository.h b/libminifi/include/core/Repository.h
index 3de1a54..e44c479 100644
--- a/libminifi/include/core/Repository.h
+++ b/libminifi/include/core/Repository.h
@@ -242,7 +242,7 @@ class Repository : public virtual core::SerializableComponent, public core::Trac
   // thread
   std::thread thread_;
   // whether the monitoring thread is running for the repo while it was enabled
-  bool running_;
+  std::atomic<bool> running_;
   // whether stop accepting provenace event
   std::atomic<bool> repo_full_;
   // repoSize
diff --git a/libminifi/test/rocksdb-tests/RepoTests.cpp b/libminifi/test/rocksdb-tests/RepoTests.cpp
index e970c40..7521d6f 100644
--- a/libminifi/test/rocksdb-tests/RepoTests.cpp
+++ b/libminifi/test/rocksdb-tests/RepoTests.cpp
@@ -326,3 +326,84 @@ TEST_CASE("Test FlowFile Restore", "[TestFFR6]") {
 
   LogTestController::getInstance().reset();
 }
+
+TEST_CASE("Flush deleted flowfiles before shutdown", "[TestFFR7]") {
+  class TestFlowFileRepository: public core::repository::FlowFileRepository{
+   public:
+    explicit TestFlowFileRepository(const std::string& name)
+        : core::SerializableComponent(name),
+          FlowFileRepository(name, FLOWFILE_REPOSITORY_DIRECTORY, MAX_FLOWFILE_REPOSITORY_ENTRY_LIFE_TIME,
+                             MAX_FLOWFILE_REPOSITORY_STORAGE_SIZE, 1) {}
+    void flush() override {
+      FlowFileRepository::flush();
+      if (onFlush_) {
+        onFlush_();
+      }
+    }
+    std::function<void()> onFlush_;
+  };
+
+  TestController testController;
+  char format[] = "/var/tmp/testRepo.XXXXXX";
+  auto dir = testController.createTempDirectory(format);
+
+  auto config = std::make_shared<minifi::Configure>();
+  config->set(minifi::Configure::nifi_flowfile_repository_directory_default, utils::file::FileUtils::concat_path(dir, "flowfile_repository"));
+
+  auto content_repo = std::make_shared<core::repository::VolatileContentRepository>();
+
+  auto connection = std::make_shared<minifi::Connection>(nullptr, nullptr, "Connection");
+  std::map<std::string, std::shared_ptr<core::Connectable>> connectionMap{{connection->getUUIDStr(), connection}};
+  // initialize repository
+  {
+    std::shared_ptr<TestFlowFileRepository> ff_repository = std::make_shared<TestFlowFileRepository>("flowFileRepository");
+
+    std::atomic<int> flush_counter{0};
+
+    std::atomic<bool> stop{false};
+    std::thread shutdown{[&] {
+      while (!stop.load()) {
+        std::this_thread::sleep_for(std::chrono::milliseconds{10});
+      }
+      ff_repository->stop();
+    }};
+
+    ff_repository->onFlush_ = [&] {
+      if (++flush_counter != 1) {
+        return;
+      }
+
+      for (int keyIdx = 0; keyIdx < 100; ++keyIdx) {
+        auto file = std::make_shared<minifi::FlowFileRecord>(ff_repository, nullptr);
+        file->setUuidConnection(connection->getUUIDStr());
+        // Serialize is sync
+        REQUIRE(file->Serialize());
+        if (keyIdx % 2 == 0) {
+          // delete every second flowFile
+          REQUIRE(ff_repository->Delete(file->getUUIDStr()));
+        }
+      }
+      stop = true;
+      // wait for the shutdown thread to start waiting for the worker thread
+      std::this_thread::sleep_for(std::chrono::milliseconds{100});
+    };
+
+    ff_repository->setConnectionMap(connectionMap);
+    REQUIRE(ff_repository->initialize(config));
+    ff_repository->loadComponent(content_repo);
+    ff_repository->start();
+
+    shutdown.join();
+  }
+
+  // check if the deleted flowfiles are indeed deleted
+  {
+    std::shared_ptr<TestFlowFileRepository> ff_repository = std::make_shared<TestFlowFileRepository>("flowFileRepository");
+    ff_repository->setConnectionMap(connectionMap);
+    REQUIRE(ff_repository->initialize(config));
+    ff_repository->loadComponent(content_repo);
+    ff_repository->start();
+    std::this_thread::sleep_for(std::chrono::milliseconds{100});
+    REQUIRE(connection->getQueueSize() == 50);
+  }
+}


[nifi-minifi-cpp] 02/03: MINIFICPP-1273 - Drain connections on flow shutdown

Posted by ab...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aboda pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit ff785cea511c4266525a4f9b6f5eccdd90817aa4
Author: Adam Debreceni <ad...@protonmail.com>
AuthorDate: Tue Jun 30 11:27:09 2020 +0200

    MINIFICPP-1273 - Drain connections on flow shutdown
    
    Signed-off-by: Arpad Boda <ab...@apache.org>
    
    This closes #827
---
 CMakeLists.txt                                    |   2 +
 libminifi/include/Connection.h                    |   2 +-
 libminifi/include/core/ProcessGroup.h             |   2 +
 libminifi/src/Connection.cpp                      |  10 +-
 libminifi/src/FlowController.cpp                  |   5 +-
 libminifi/src/core/ProcessGroup.cpp               |  19 +++-
 libminifi/test/flow-tests/CMakeLists.txt          |  31 ++++++
 libminifi/test/flow-tests/FlowControllerTests.cpp | 125 ++++++++++++++++++++++
 8 files changed, 185 insertions(+), 11 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 700b95f..3479070 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -766,6 +766,8 @@ endif()
 ## Add KeyValueStorageService tests
 registerTest("${TEST_DIR}/keyvalue-tests")
 
+registerTest("${TEST_DIR}/flow-tests")
+
 include(BuildDocs)
 
 include(DockerConfig)
diff --git a/libminifi/include/Connection.h b/libminifi/include/Connection.h
index 64a805e..5a40d87 100644
--- a/libminifi/include/Connection.h
+++ b/libminifi/include/Connection.h
@@ -168,7 +168,7 @@ class Connection : public core::Connectable, public std::enable_shared_from_this
   // Poll the flow file from queue, the expired flow file record also being returned
   std::shared_ptr<core::FlowFile> poll(std::set<std::shared_ptr<core::FlowFile>> &expiredFlowRecords);
   // Drain the flow records
-  void drain();
+  void drain(bool delete_permanently);
 
   void yield() override {}
 
diff --git a/libminifi/include/core/ProcessGroup.h b/libminifi/include/core/ProcessGroup.h
index fcbb78a..9944658 100644
--- a/libminifi/include/core/ProcessGroup.h
+++ b/libminifi/include/core/ProcessGroup.h
@@ -228,6 +228,8 @@ class ProcessGroup {
 
   void getConnections(std::map<std::string, std::shared_ptr<Connectable>> &connectionMap);
 
+  void drainConnections();
+
  protected:
   void startProcessingProcessors(const std::shared_ptr<TimerDrivenSchedulingAgent> timeScheduler, const std::shared_ptr<EventDrivenSchedulingAgent> &eventScheduler, const std::shared_ptr<CronDrivenSchedulingAgent> &cronScheduler); // NOLINT
 
diff --git a/libminifi/src/Connection.cpp b/libminifi/src/Connection.cpp
index 9038e91..06cfcce 100644
--- a/libminifi/src/Connection.cpp
+++ b/libminifi/src/Connection.cpp
@@ -262,15 +262,17 @@ std::shared_ptr<core::FlowFile> Connection::poll(std::set<std::shared_ptr<core::
   return NULL;
 }
 
-void Connection::drain() {
+void Connection::drain(bool delete_permanently) {
   std::lock_guard<std::mutex> lock(mutex_);
 
   while (!queue_.empty()) {
     std::shared_ptr<core::FlowFile> item = queue_.front();
     queue_.pop();
-    logger_->log_debug("Delete flow file UUID %s from connection %s, because it expired", item->getUUIDStr(), name_);
-    if (flow_repository_->Delete(item->getUUIDStr())) {
-      item->setStoredToRepository(false);
+    logger_->log_debug("Delete flow file UUID %s from connection %s", item->getUUIDStr(), name_);
+    if (delete_permanently) {
+      if (flow_repository_->Delete(item->getUUIDStr())) {
+        item->setStoredToRepository(false);
+      }
     }
   }
   queued_data_size_ = 0;
diff --git a/libminifi/src/FlowController.cpp b/libminifi/src/FlowController.cpp
index 3976936..669285b 100644
--- a/libminifi/src/FlowController.cpp
+++ b/libminifi/src/FlowController.cpp
@@ -250,6 +250,9 @@ int16_t FlowController::stop(bool force, uint64_t timeToWait) {
      * -Stopping the schedulers doesn't actually quit the onTrigger functions of processors
      * -They only guarantee that the processors are not scheduled any more
      * -After the threadpool is stopped we can make sure that processors don't need repos and controllers anymore */
+    if (this->root_) {
+      this->root_->drainConnections();
+    }
     this->flow_file_repo_->stop();
     this->provenance_repo_->stop();
     // stop the ControllerServices
@@ -923,7 +926,7 @@ int16_t FlowController::clearConnection(const std::string &connection) {
     auto conn = connections.find(connection);
     if (conn != connections.end()) {
       logger_->log_info("Clearing connection %s", connection);
-      conn->second->drain();
+      conn->second->drain(true);
     }
   }
   return -1;
diff --git a/libminifi/src/core/ProcessGroup.cpp b/libminifi/src/core/ProcessGroup.cpp
index 9eec44c..ee88d79 100644
--- a/libminifi/src/core/ProcessGroup.cpp
+++ b/libminifi/src/core/ProcessGroup.cpp
@@ -92,13 +92,12 @@ ProcessGroup::~ProcessGroup() {
     onScheduleTimer_->stop();
   }
 
-  for (auto &&connection : connections_) {
-    connection->drain();
+  for (auto&& connection : connections_) {
+    connection->drain(false);
   }
 
-  for (std::set<ProcessGroup *>::iterator it = child_process_groups_.begin(); it != child_process_groups_.end(); ++it) {
-    ProcessGroup *processGroup(*it);
-    delete processGroup;
+  for (ProcessGroup* childGroup : child_process_groups_) {
+    delete childGroup;
   }
 }
 
@@ -403,6 +402,16 @@ void ProcessGroup::removeConnection(std::shared_ptr<Connection> connection) {
   }
 }
 
+void ProcessGroup::drainConnections() {
+  for (auto&& connection : connections_) {
+    connection->drain(false);
+  }
+
+  for (ProcessGroup* childGroup : child_process_groups_) {
+    childGroup->drainConnections();
+  }
+}
+
 } /* namespace core */
 } /* namespace minifi */
 } /* namespace nifi */
diff --git a/libminifi/test/flow-tests/CMakeLists.txt b/libminifi/test/flow-tests/CMakeLists.txt
new file mode 100644
index 0000000..a17cf23
--- /dev/null
+++ b/libminifi/test/flow-tests/CMakeLists.txt
@@ -0,0 +1,31 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+file(GLOB FLOW_TESTS  "*.cpp")
+SET(FLOW_TEST_COUNT 0)
+FOREACH(testfile ${FLOW_TESTS})
+    get_filename_component(testfilename "${testfile}" NAME_WE)
+    add_executable("${testfilename}" "${testfile}")
+    createTests("${testfilename}")
+    target_link_libraries(${testfilename} ${CATCH_MAIN_LIB})
+    target_wholearchive_library(${testfilename} minifi-standard-processors)
+    MATH(EXPR FLOW_TEST_COUNT "${FLOW_TEST_COUNT}+1")
+    add_test(NAME "${testfilename}" COMMAND "${testfilename}" WORKING_DIRECTORY ${TEST_DIR})
+ENDFOREACH()
+message("-- Finished building ${FLOW_TEST_COUNT} flow related test file(s)...")
diff --git a/libminifi/test/flow-tests/FlowControllerTests.cpp b/libminifi/test/flow-tests/FlowControllerTests.cpp
new file mode 100644
index 0000000..eb444f6
--- /dev/null
+++ b/libminifi/test/flow-tests/FlowControllerTests.cpp
@@ -0,0 +1,125 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#undef NDEBUG
+#include <chrono>
+#include <map>
+#include <memory>
+#include <string>
+#include <thread>
+
+#include "core/Core.h"
+#include "core/repository/AtomicRepoEntries.h"
+#include "core/RepositoryFactory.h"
+#include "FlowFileRecord.h"
+#include "provenance/Provenance.h"
+#include "properties/Configure.h"
+#include "../unit/ProvenanceTestHelper.h"
+#include "../TestBase.h"
+#include "YamlConfiguration.h"
+
+const char* yamlConfig =
+R"(
+Flow Controller:
+    name: MiNiFi Flow
+    id: 2438e3c8-015a-1000-79ca-83af40ec1990
+Processors:
+  - name: Generator
+    id: 2438e3c8-015a-1000-79ca-83af40ec1991
+    class: org.apache.nifi.processors.standard.GenerateFlowFile
+    max concurrent tasks: 1
+    scheduling strategy: TIMER_DRIVEN
+    scheduling period: 100 ms
+    penalization period: 300 ms
+    yield period: 100 ms
+    run duration nanos: 0
+    auto-terminated relationships list:
+    Properties:
+      Batch Size: 10
+  - name: LogAttribute
+    id: 2438e3c8-015a-1000-79ca-83af40ec1992
+    class: org.apache.nifi.processors.standard.LogAttribute
+    max concurrent tasks: 1
+    scheduling strategy: TIMER_DRIVEN
+    scheduling period: 1000 sec
+    penalization period: 30 sec
+    yield period: 1 sec
+    run duration nanos: 0
+    auto-terminated relationships list:
+
+Connections:
+  - name: Gen
+    id: 2438e3c8-015a-1000-79ca-83af40ec1997
+    source name: Generator
+    source id: 2438e3c8-015a-1000-79ca-83af40ec1991
+    source relationship name: success
+    destination name: LogAttribute
+    destination id: 2438e3c8-015a-1000-79ca-83af40ec1992
+    max work queue size: 0
+    max work queue data size: 1 MB
+    flowfile expiration: 60 sec
+
+Remote Processing Groups:
+
+)";
+
+TEST_CASE("Flow shutdown drains connections", "[TestFlow1]") {
+  TestController testController;
+  char format[] = "/tmp/flowTest.XXXXXX";
+  std::string dir = testController.createTempDirectory(format);
+
+  std::string yamlPath = utils::file::FileUtils::concat_path(dir, "config.yml");
+  std::ofstream{yamlPath} << yamlConfig;
+
+  std::shared_ptr<minifi::Configure> configuration = std::make_shared<minifi::Configure>();
+  std::shared_ptr<core::Repository> prov_repo = std::make_shared<TestRepository>();
+  std::shared_ptr<core::Repository> ff_repo = std::make_shared<TestFlowRepository>();
+  std::shared_ptr<core::ContentRepository> content_repo = std::make_shared<core::repository::VolatileContentRepository>();
+
+  configuration->set(minifi::Configure::nifi_flow_configuration_file, yamlPath);
+
+  REQUIRE(content_repo->initialize(configuration));
+  std::shared_ptr<minifi::io::StreamFactory> stream_factory = minifi::io::StreamFactory::getInstance(configuration);
+
+  std::map<std::string, std::shared_ptr<minifi::Connection>> connectionMap;
+  std::unique_ptr<core::FlowConfiguration> flow = utils::make_unique<core::YamlConfiguration>(prov_repo, ff_repo, content_repo, stream_factory, configuration, yamlPath);
+  std::shared_ptr<core::ProcessGroup> root = flow->getRoot();
+  std::shared_ptr<minifi::FlowController> controller = std::make_shared<minifi::FlowController>(
+      prov_repo, ff_repo, configuration,
+      std::move(flow),
+      content_repo, DEFAULT_ROOT_GROUP_NAME, true);
+
+
+  root->getConnections(connectionMap);
+  // adds the single connection to the map both by name and id
+  REQUIRE(connectionMap.size() == 2);
+  controller->load(root);
+  controller->start();
+
+  std::this_thread::sleep_for(std::chrono::milliseconds{1000});
+
+  for (auto& it : connectionMap) {
+    REQUIRE(it.second->getQueueSize() > 10);
+  }
+
+  controller->stop(true);
+
+  for (auto& it : connectionMap) {
+    REQUIRE(it.second->isEmpty());
+  }
+}