Skip to content

Fix port bind #117

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 2 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
readme = f.read()

setup(
version='1.10.0',
version='1.10.1',
name='testgres',
packages=['testgres', 'testgres.operations', 'testgres.helpers'],
description='Testing utility for PostgreSQL and its extensions',
Expand Down
4 changes: 3 additions & 1 deletion testgres/operations/remote_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import tempfile
import platform

from ..utils import reserve_port

# we support both pg8000 and psycopg2
try:
import psycopg2 as pglib
Expand Down Expand Up @@ -392,7 +394,7 @@ def db_connect(self, dbname, user, password=None, host="localhost", port=5432):
"""
Established SSH tunnel and Connects to a PostgreSQL
"""
self.establish_ssh_tunnel(local_port=port, remote_port=5432)
self.establish_ssh_tunnel(local_port=reserve_port(), remote_port=5432)
try:
conn = pglib.connect(
host=host,
Expand Down