Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 58cd26f

Browse files
committed
tests: slow_start() fix
1 parent 4d8b6f5 commit 58cd26f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/helpers/ptrack_helpers.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,15 @@ def slow_start(self, replica=False):
124124
# "SELECT not pg_is_in_recovery()",
125125
# suppress={testgres.NodeConnection})
126126
if replica:
127-
query = 'SELECT not pg_is_in_recovery()'
128-
else:
129127
query = 'SELECT pg_is_in_recovery()'
128+
else:
129+
query = 'SELECT not pg_is_in_recovery()'
130130

131131
self.start()
132132
while True:
133133
try:
134-
self.safe_psql(
135-
'postgres',
136-
query)
137-
break
134+
if self.safe_psql('postgres', query) == 't\n':
135+
break
138136
except testgres.QueryException as e:
139137
if 'database system is starting up' in e[0]:
140138
continue

0 commit comments

Comments
 (0)