martinzink commented on code in PR #1541:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1541#discussion_r1155644875
##########
extensions/expression-language/tests/ExpressionLanguageTests.cpp:
##########
@@ -1342,13 +1342,18 @@ TEST_CASE("Reverse DNS lookup with valid timeout
parameter", "[ExpressionLanguag
SECTION("Should timeout") {
auto reverse_lookup_expr_0ms =
expression::compile("${reverseDnsLookup(${ip_addr}, 0)}");
-
REQUIRE_NOTHROW(reverse_lookup_expr_0ms(expression::Parameters{flow_file_a}).asString()
== "8.8.8.8");
+ std::string reverse_lookup_result = "dns.google";
+ // Occasionally it doesn't time out even with 0ms timeout because it
finishes before the timeout-thread starts
+ for (auto number_of_tries = 1; number_of_tries <= 5 &&
reverse_lookup_result == "dns.google"; ++number_of_tries) {
+ reverse_lookup_result =
reverse_lookup_expr_0ms(expression::Parameters{flow_file_a}).asString();
+ }
Review Comment:
That makes sense, at least now this certainly wont fail :sweat_smile:
https://github.com/apache/nifi-minifi-cpp/pull/1541/commits/033f20cd28d16fd8c3c535babf06321f6082ab0a
--
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]