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

Commit0b331e6

Browse files
Releasing of reserved port in tests (#248)
* [test] TestTestgresLocal.test_pg_ctl_wait_option is correctedLet's "release" all our test nodes correctly.* [test] TestTestgresLocal.test_simple_with_bin_dir is correctedLet's "release" all our test nodes correctly.
1 parent5f8f5dd commit0b331e6

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

‎tests/test_testgres_common.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -883,10 +883,20 @@ def test_backup_wrong_xlog_method(self, node_svc: PostgresNodeService):
883883

884884
deftest_pg_ctl_wait_option(self,node_svc:PostgresNodeService):
885885
assertisinstance(node_svc,PostgresNodeService)
886-
C_MAX_ATTEMPTS=50
886+
with__class__.helper__get_node(node_svc)asnode:
887+
self.impl__test_pg_ctl_wait_option(node_svc,node)
887888

888-
node=__class__.helper__get_node(node_svc)
889+
defimpl__test_pg_ctl_wait_option(
890+
self,
891+
node_svc:PostgresNodeService,
892+
node:PostgresNode
893+
)->None:
894+
assertisinstance(node_svc,PostgresNodeService)
895+
assertisinstance(node,PostgresNode)
889896
assertnode.status()==NodeStatus.Uninitialized
897+
898+
C_MAX_ATTEMPTS=50
899+
890900
node.init()
891901
assertnode.status()==NodeStatus.Stopped
892902
node.start(wait=False)
@@ -950,7 +960,6 @@ def test_pg_ctl_wait_option(self, node_svc: PostgresNodeService):
950960
raiseException("Unexpected node status: {0}.".format(s1))
951961

952962
logging.info("OK. Node is stopped.")
953-
node.cleanup()
954963

955964
deftest_replicate(self,node_svc:PostgresNodeService):
956965
assertisinstance(node_svc,PostgresNodeService)

‎tests/test_testgres_local.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,10 @@ def test_simple_with_bin_dir(self):
341341
bin_dir=node.bin_dir
342342

343343
app=NodeApp()
344-
correct_bin_dir=app.make_simple(base_dir=node.base_dir,bin_dir=bin_dir)
345-
correct_bin_dir.slow_start()
346-
correct_bin_dir.safe_psql("SELECT 1;")
347-
correct_bin_dir.stop()
344+
withapp.make_simple(base_dir=node.base_dir,bin_dir=bin_dir)ascorrect_bin_dir:
345+
correct_bin_dir.slow_start()
346+
correct_bin_dir.safe_psql("SELECT 1;")
347+
correct_bin_dir.stop()
348348

349349
whileTrue:
350350
try:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp