fgerlits commented on code in PR #1507:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1507#discussion_r1104319441


##########
libminifi/test/unit/FileSystemRepositoryTests.cpp:
##########
@@ -47,7 +50,6 @@ TEST_CASE("Test Physical memory usage", 
"[testphysicalmemoryusage]") {
     stream->write(fragment.as_span<const std::byte>());
   }
 
-  const auto end_memory = 
utils::OsUtils::getCurrentProcessPhysicalMemoryUsage();
-
-  REQUIRE(gsl::narrow<size_t>(end_memory - start_memory) < 1_MB);
+  using org::apache::nifi::minifi::utils::verifyEventHappenedInPollTime;
+  REQUIRE(verifyEventHappenedInPollTime(5s, [&] { return 
gsl::narrow<size_t>(utils::OsUtils::getCurrentProcessPhysicalMemoryUsage() - 
start_memory) < 5_MB; }, 100ms));

Review Comment:
   `gsl::narrow<size_t>(end_memory - start_memory)` still terminates if 
`end_memory` is less than `start_memory`.  I think `end_memory < start_memory + 
int64_t{5_MB}` would be better.



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