Skip to content

Port numbers management is improved (#164) #165

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 6 commits into from
Dec 15, 2024
Merged
Changes from 1 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
Prev Previous commit
Next Next commit
TestgresTests::test_the_same_port is corrected
  • Loading branch information
dmitry-lipetsk committed Dec 12, 2024
commit 85d2aa3917f8210dce06531b563ec34c42e6b544
14 changes: 11 additions & 3 deletions tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,10 +1051,18 @@ def test_parse_pg_version(self):
def test_the_same_port(self):
with get_new_node() as node:
node.init().start()
self.assertTrue(node._should_free_port)
self.assertEqual(type(node.port), int)

with get_new_node() as node2:
node2.port = node.port
node2.init().start()
with get_new_node(port=node.port) as node2:
self.assertEqual(type(node2.port), int)
self.assertEqual(node2.port, node.port)
self.assertFalse(node2._should_free_port)

with self.assertRaises(StartNodeException) as ctx:
node2.init().start()

self.assertIn("Cannot start node", str(ctx.exception))

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