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

Skip to content

Add promote() method #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 4, 2018
Merged
Prev Previous commit
Use pg_is_in_recovery() instead of relying on transaction_read_only G…
…UC variable in promote() func
  • Loading branch information
zilder committed Jun 4, 2018
commit f5fe963b0966e33d7e4da3fac35a93f14c3872f5
4 changes: 2 additions & 2 deletions testgres/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,11 +713,11 @@ def promote(self, dbname=None, username=None):
# for versions below 10 `promote` is asynchronous so we need to wait
# until it actually becomes writable
if self._pg_version < '10':
check_query = "SHOW transaction_read_only"
check_query = "SELECT pg_is_in_recovery()"

self.poll_query_until(
query=check_query,
expected="off",
expected=False,
dbname=dbname,
username=username,
max_attempts=0) # infinite
Expand Down