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

[BUG FIX] A problem with socket directory is fixed#180

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
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
30 changes: 29 additions & 1 deletiontestgres/node.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@
import subprocess
import threading
import tempfile
import platform
from queue import Queue

import time
Expand DownExpand Up@@ -1925,7 +1926,7 @@ def make_simple(

# Define delayed propertyes
if not ("unix_socket_directories" in options.keys()):
options["unix_socket_directories"] = __class__._gettempdir()
options["unix_socket_directories"] = __class__._gettempdir_for_socket()

# Set config values
node.set_auto_conf(options)
Expand All@@ -1938,6 +1939,33 @@ def make_simple(

return node

def _gettempdir_for_socket():
platform_system_name = platform.system().lower()

if platform_system_name == "windows":
return __class__._gettempdir()

#
# [2025-02-17] Hot fix.
#
# Let's use hard coded path as Postgres likes.
#
# pg_config_manual.h:
#
# #ifndef WIN32
# #define DEFAULT_PGSOCKET_DIR "/tmp"
# #else
# #define DEFAULT_PGSOCKET_DIR ""
# #endif
#
# On the altlinux-10 tempfile.gettempdir() may return
# the path to "private" temp directiry - "/temp/.private/<username>/"
#
# But Postgres want to find a socket file in "/tmp" (see above).
#

return "/tmp"

def _gettempdir():
v = tempfile.gettempdir()

Expand Down
16 changes: 11 additions & 5 deletionstests/test_simple.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1244,13 +1244,19 @@ def test_simple_with_bin_dir(self):
correct_bin_dir = app.make_simple(base_dir=node.base_dir, bin_dir=bin_dir)
correct_bin_dir.slow_start()
correct_bin_dir.safe_psql("SELECT 1;")
correct_bin_dir.stop()

while True:
try:
app.make_simple(base_dir=node.base_dir, bin_dir="wrong/path")
except FileNotFoundError:
break # Expected error
except ExecUtilException:
break # Expected error

try:
wrong_bin_dir = app.make_empty(base_dir=node.base_dir, bin_dir="wrong/path")
wrong_bin_dir.slow_start()
raise RuntimeError("Error was expected.") # We should not reach this
except FileNotFoundError:
pass # Expected error

return

def test_set_auto_conf(self):
# elements contain [property id, value, storage value]
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp