Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

os_ops::rmdirs (local, remote) was refactored#207

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
test_pg_ctl_wait_option (local, remote) is corrected
  • Loading branch information
@dmitry-lipetsk
dmitry-lipetsk committedMar 3, 2025
commit319a9d9e69db7b36e56b79f5a216957076d56dc1
65 changes: 55 additions & 10 deletionstests/test_simple.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -428,16 +428,61 @@ def test_backup_wrong_xlog_method(self):
node.backup(xlog_method='wrong')

def test_pg_ctl_wait_option(self):
with get_new_node() as node:
node.init().start(wait=False)
while True:
try:
node.stop(wait=False)
break
except ExecUtilException:
# it's ok to get this exception here since node
# could be not started yet
pass
C_MAX_ATTEMPTS = 50

node = get_new_node()
assert node.status() == testgres.NodeStatus.Uninitialized
node.init()
assert node.status() == testgres.NodeStatus.Stopped
node.start(wait=False)
nAttempt = 0
while True:
if nAttempt == C_MAX_ATTEMPTS:
raise Exception("Could not stop node.")

nAttempt += 1

if nAttempt > 1:
logging.info("Wait 1 second.")
time.sleep(1)
logging.info("")

logging.info("Try to stop node. Attempt #{0}.".format(nAttempt))

try:
node.stop(wait=False)
break
except ExecUtilException as e:
# it's ok to get this exception here since node
# could be not started yet
logging.info("Node is not stopped. Exception ({0}): {1}".format(type(e).__name__, e))
continue

logging.info("OK. Stop command was executed. Let's wait while our node will stop really.")
nAttempt = 0
while True:
if nAttempt == C_MAX_ATTEMPTS:
raise Exception("Could not stop node.")

nAttempt += 1
if nAttempt > 1:
logging.info("Wait 1 second.")
time.sleep(1)
logging.info("")

logging.info("Attempt #{0}.".format(nAttempt))
s1 = node.status()

if s1 == testgres.NodeStatus.Running:
continue

if s1 == testgres.NodeStatus.Stopped:
break

raise Exception("Unexpected node status: {0}.".format(s1))

logging.info("OK. Node is stopped.")
node.cleanup()

def test_replicate(self):
with get_new_node() as node:
Expand Down
65 changes: 55 additions & 10 deletionstests/test_simple_remote.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -499,16 +499,61 @@ def test_backup_wrong_xlog_method(self):
node.backup(xlog_method='wrong')

def test_pg_ctl_wait_option(self):
with __class__.helper__get_node() as node:
node.init().start(wait=False)
while True:
try:
node.stop(wait=False)
break
except ExecUtilException:
# it's ok to get this exception here since node
# could be not started yet
pass
C_MAX_ATTEMPTS = 50

node = __class__.helper__get_node()
assert node.status() == testgres.NodeStatus.Uninitialized
node.init()
assert node.status() == testgres.NodeStatus.Stopped
node.start(wait=False)
nAttempt = 0
while True:
if nAttempt == C_MAX_ATTEMPTS:
raise Exception("Could not stop node.")

nAttempt += 1

if nAttempt > 1:
logging.info("Wait 1 second.")
time.sleep(1)
logging.info("")

logging.info("Try to stop node. Attempt #{0}.".format(nAttempt))

try:
node.stop(wait=False)
break
except ExecUtilException as e:
# it's ok to get this exception here since node
# could be not started yet
logging.info("Node is not stopped. Exception ({0}): {1}".format(type(e).__name__, e))
continue

logging.info("OK. Stop command was executed. Let's wait while our node will stop really.")
nAttempt = 0
while True:
if nAttempt == C_MAX_ATTEMPTS:
raise Exception("Could not stop node.")

nAttempt += 1
if nAttempt > 1:
logging.info("Wait 1 second.")
time.sleep(1)
logging.info("")

logging.info("Attempt #{0}.".format(nAttempt))
s1 = node.status()

if s1 == testgres.NodeStatus.Running:
continue

if s1 == testgres.NodeStatus.Stopped:
break

raise Exception("Unexpected node status: {0}.".format(s1))

logging.info("OK. Node is stopped.")
node.cleanup()

def test_replicate(self):
with __class__.helper__get_node() as node:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp