fgerlits commented on a change in pull request #861:
URL: https://github.com/apache/nifi-minifi-cpp/pull/861#discussion_r465615443



##########
File path: libminifi/test/flow-tests/FlowControllerTests.cpp
##########
@@ -133,12 +144,9 @@ TEST_CASE("Flow shutdown waits for a while", 
"[TestFlow2]") {
   testController.startFlow();
 
   // wait for the source processor to enqueue its flowFiles
-  int tryCount = 0;
-  while (tryCount++ < 10 && root->getTotalFlowFileCount() != 3) {
-    std::this_thread::sleep_for(std::chrono::milliseconds{20});
-  }
+  busy_wait(std::chrono::milliseconds{50}, [&] {return 
root->getTotalFlowFileCount() != 0;});

Review comment:
       @adebreceni It wasn't really a proposal, but I would prefer two separate 
functions `verifyEventHappenedInPollTime()` and 
`verifyEventHappenedInPollTimeWithBusyWait()` (just an example, feel free to 
find a shorter name) rather than a single function where an argument value of 
-1 means "use the busy version".
   
   [TBH, I am not a fan of the `verifyEventHappenedInPollTime` name, as 
something like `REQUIRE(happensBeforeTimeout(...))` would read better, but 
renaming it is probably not in scope for this PR.]




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

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


Reply via email to