8000 Fix port bind by demonolock · Pull Request #117 · postgrespro/testgres · GitHub
[go: up one dir, main page]

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
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
Next Next commit
Fix port bind
  • Loading branch information
vshepard committed Mar 27, 2024
commit ba013149b445377f4895e0b21d8e81072c2991de
4 changes: 3 additions & 1 deletion testgres/operations/remote_ops.py
6718
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
0