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 2023/01/18 15:39:59 UTC
[GitHub] [nifi-minifi-cpp] adamdebreceni commented on a diff in pull request #1461: MINIFICPP-1983 Mount files in MiNiFi test containers and additional refactoring
adamdebreceni commented on code in PR #1461:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1461#discussion_r1073705141
##########
docker/test/integration/cluster/checkers/PostgresChecker.py:
##########
@@ -0,0 +1,18 @@
+import time
+
+
+class PostgresChecker:
+ def __init__(self, container_communicator):
+ self.container_communicator = container_communicator
+
+ def __query_postgres_server(self, postgresql_container_name, query, number_of_rows):
+ (code, output) = self.container_communicator.execute_command(postgresql_container_name, ["psql", "-U", "postgres", "-c", query])
+ return code == 0 and str(number_of_rows) + " rows" in output
+
+ def check_query_results(self, postgresql_container_name, query, number_of_rows, timeout_seconds):
+ start_time = time.perf_counter()
+ while (time.perf_counter() - start_time) < timeout_seconds:
+ if self.__query_postgres_server(postgresql_container_name, query, number_of_rows):
+ return True
+ time.sleep(2)
+ return False
Review Comment:
could we use the `retry_check` wrapper for this method?
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org