Added waiting to other PostgreSQL tests

This commit is contained in:
Alexey Gerasimchuck 2023-08-17 08:24:17 +00:00
parent 6b44088a8b
commit adc73beb93
2 changed files with 8 additions and 1 deletions

View File

@ -40,7 +40,10 @@ server_port = 5433
def started_cluster():
try:
cluster.start()
# Wait for the PostgreSQL handler to start.
# Cluster.start waits until port 9000 becomes accessible.
# Server opens the PostgreSQL compatibility port a bit later.
cluster.instances["node"].wait_for_log_line("PostgreSQL compatibility protocol")
yield cluster
except Exception as ex:
logging.exception(ex)

View File

@ -26,6 +26,10 @@ def started_cluster():
cluster.start()
node1.query("CREATE DATABASE test")
node2.query("CREATE DATABASE test")
# Wait for the PostgreSQL handler to start.
# cluster.start waits until port 9000 becomes accessible.
# Server opens the PostgreSQL compatibility port a bit later.
node1.wait_for_log_line("PostgreSQL compatibility protocol")
yield cluster
finally: