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

Fix error handling and port management for Windows#172

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 fromall commits
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
3 changes: 2 additions & 1 deletiontestgres/node.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -791,8 +791,9 @@ def start(self, params=[], wait=True):
"start"] + params # yapf: disable

def LOCAL__start_node():
# 'error' will be None on Windows
_, _, error = execute_utility(_params, self.utils_log_file, verbose=True)
assert type(error) == str # noqa: E721
asserterror is None ortype(error) == str # noqa: E721
if error and 'does not exist' in error:
raise Exception(error)

Expand Down
14 changes: 7 additions & 7 deletionstests/test_simple.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1054,7 +1054,7 @@ def test_the_same_port(self):
self.assertTrue(node._should_free_port)
self.assertEqual(type(node.port), int)
node_port_copy = node.port
self.assertEqual(node.safe_psql("SELECT 1;"), b'1\n')
self.assertEqual(rm_carriage_returns(node.safe_psql("SELECT 1;")), b'1\n')

with get_new_node(port=node.port) as node2:
self.assertEqual(type(node2.port), int)
Expand All@@ -1069,7 +1069,7 @@ def test_the_same_port(self):
# node is still working
self.assertEqual(node.port, node_port_copy)
self.assertTrue(node._should_free_port)
self.assertEqual(node.safe_psql("SELECT 3;"), b'3\n')
self.assertEqual(rm_carriage_returns(node.safe_psql("SELECT 3;")), b'3\n')

class tagPortManagerProxy:
sm_prev_testgres_reserve_port = None
Expand DownExpand Up@@ -1175,7 +1175,7 @@ def test_port_rereserve_during_node_start(self):
self.assertTrue(node1._should_free_port)
self.assertEqual(type(node1.port), int) # noqa: E721
node1_port_copy = node1.port
self.assertEqual(node1.safe_psql("SELECT 1;"), b'1\n')
self.assertEqual(rm_carriage_returns(node1.safe_psql("SELECT 1;")), b'1\n')

with __class__.tagPortManagerProxy(node1.port, C_COUNT_OF_BAD_PORT_USAGE):
assert __class__.tagPortManagerProxy.sm_DummyPortNumber == node1.port
Expand All@@ -1191,12 +1191,12 @@ def test_port_rereserve_during_node_start(self):
self.assertEqual(__class__.tagPortManagerProxy.sm_DummyPortTotalUsage, C_COUNT_OF_BAD_PORT_USAGE)
self.assertTrue(node2.is_started)

self.assertEqual(node2.safe_psql("SELECT 2;"), b'2\n')
self.assertEqual(rm_carriage_returns(node2.safe_psql("SELECT 2;")), b'2\n')

# node1 is still working
self.assertEqual(node1.port, node1_port_copy)
self.assertTrue(node1._should_free_port)
self.assertEqual(node1.safe_psql("SELECT 3;"), b'3\n')
self.assertEqual(rm_carriage_returns(node1.safe_psql("SELECT 3;")), b'3\n')

def test_port_conflict(self):
assert testgres.PostgresNode._C_MAX_START_ATEMPTS > 1
Expand All@@ -1208,7 +1208,7 @@ def test_port_conflict(self):
self.assertTrue(node1._should_free_port)
self.assertEqual(type(node1.port), int) # noqa: E721
node1_port_copy = node1.port
self.assertEqual(node1.safe_psql("SELECT 1;"), b'1\n')
self.assertEqual(rm_carriage_returns(node1.safe_psql("SELECT 1;")), b'1\n')

with __class__.tagPortManagerProxy(node1.port, C_COUNT_OF_BAD_PORT_USAGE):
assert __class__.tagPortManagerProxy.sm_DummyPortNumber == node1.port
Expand All@@ -1233,7 +1233,7 @@ def test_port_conflict(self):
# node1 is still working
self.assertEqual(node1.port, node1_port_copy)
self.assertTrue(node1._should_free_port)
self.assertEqual(node1.safe_psql("SELECT 3;"), b'3\n')
self.assertEqual(rm_carriage_returns(node1.safe_psql("SELECT 3;")), b'3\n')

def test_simple_with_bin_dir(self):
with get_new_node() as node:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp