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 2020/12/14 16:18:37 UTC

[GitHub] [nifi-minifi-cpp] fgerlits commented on a change in pull request #959: MINIFICPP-1424 Stabilize several flaky test suites

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



##########
File path: libminifi/test/persistence-tests/PersistenceTests.cpp
##########
@@ -326,10 +334,12 @@ TEST_CASE("Persisted flowFiles are updated on modification", "[TestP1]") {
     ff_repository->start();
     // wait for FlowFileRepository to start and notify the owners of
     // the resurrected FlowFiles
-    std::this_thread::sleep_for(std::chrono::milliseconds{100});
-
     std::set<std::shared_ptr<core::FlowFile>> expired;
-    auto file = flow.output->poll(expired);
+    std::shared_ptr<org::apache::nifi::minifi::core::FlowFile> file = nullptr;
+    for (auto i = 0; i < 20 && !file; ++i) {

Review comment:
       you could use `verifyEventHappenedInPollTime` (in IntegrationTestUtils.h) for this; also in two other cases in RepoTests

##########
File path: libminifi/include/io/tls/TLSServerSocket.h
##########
@@ -53,7 +53,7 @@ class TLSServerSocket : public BaseServerSocket, public TLSSocket {
   /**
    * Registers a call back and starts the read for the server socket.
    */
-  void registerCallback(std::function<bool()> accept_function, std::function<int(std::vector<uint8_t>*, int *)> handler);
+  void registerCallback(std::function<bool()> accept_function, std::function<int(std::vector<uint8_t>*, int *)> handler, uint16_t timeout = 3000);

Review comment:
       using `std::chrono::milliseconds` would be clearer than `uint16_t`




----------------------------------------------------------------
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:
users@infra.apache.org