You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/08/30 10:07:15 UTC

[GitHub] [nifi-minifi-cpp] lordgamez commented on a diff in pull request #1411: MINIFICPP-1931 Stabilize ResourceQueueTests

lordgamez commented on code in PR #1411:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1411#discussion_r958282212


##########
libminifi/test/unit/ResourceQueueTests.cpp:
##########
@@ -28,19 +28,21 @@ using namespace std::literals::chrono_literals;
 
 namespace org::apache::nifi::minifi::utils::testing {
 
-TEST_CASE("maximum_number_of_creatable_resources", "[utils::ResourceQueue]") {
+TEST_CASE("Limiting resource queue to a maximum of 2 resources", "[utils::ResourceQueue]") {
   std::shared_ptr<core::logging::Logger> logger_{core::logging::LoggerFactory<ResourceQueue<int>>::getLogger()};
   LogTestController::getInstance().setTrace<ResourceQueue<int>>();
 
+  std::mutex resources_created_mutex;
   std::set<int> resources_created;
 
   auto worker = [&](int value, const std::shared_ptr<ResourceQueue<int>>& resource_queue) {
     auto resource = resource_queue->getResource([value]{return std::make_unique<int>(value);});
     std::this_thread::sleep_for(10ms);
+    std::lock_guard<std::mutex> lock(resources_created_mutex);
     resources_created.emplace(*resource);
   };
 
-  SECTION("Maximum 2 resources") {
+  SECTION("") {

Review Comment:
   Updated in 5f0605b2e6a9017c1768f37968c050b9e551f812



-- 
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-unsubscribe@nifi.apache.org

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