adamdebreceni commented on code in PR #1499:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1499#discussion_r1307085930


##########
libminifi/test/rocksdb-tests/DBContentRepositoryTests.cpp:
##########
@@ -103,16 +105,35 @@ TEST_CASE("Delete Claim", "[TestDBCR2]") {
 
   configuration = std::make_shared<org::apache::nifi::minifi::Configure>();
   
configuration->set(minifi::Configure::nifi_dbcontent_repository_directory_default,
 dir.string());
-  REQUIRE(content_repo->initialize(configuration));
 
-  content_repo->remove(*claim);
+  std::string readstr;
 
-  auto read_stream = content_repo->read(*claim);
+  SECTION("Sync") {
+    
configuration->set(minifi::Configure::nifi_dbcontent_repository_purge_period, 
"0 s");
+    REQUIRE(content_repo->initialize(configuration));
 
-  std::string readstr;
+    content_repo->remove(*claim);
 
-  // error tells us we have an invalid stream
-  REQUIRE(minifi::io::isError(read_stream->read(readstr)));
+    auto read_stream = content_repo->read(*claim);
+
+    // error tells us we have an invalid stream
+    REQUIRE(minifi::io::isError(read_stream->read(readstr)));
+  }
+
+  SECTION("Async") {
+    
configuration->set(minifi::Configure::nifi_dbcontent_repository_purge_period, 
"100 ms");
+    REQUIRE(content_repo->initialize(configuration));
+    content_repo->start();
+
+    content_repo->remove(*claim);
+
+    // an immediate read will still be able to access the content
+    
REQUIRE_FALSE(minifi::io::isError(content_repo->read(*claim)->read(readstr)));

Review Comment:
   it wasn't safe as the gc runs first before waiting, flipped it so that the 
gc does not run at 0, so it should be safe now



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