Skip to content

Commit 8d8a3f9

Browse files
committed
Fix: make motion_socket test Python 3.6 compatible
The `capture_output` argument for `subprocess.run` is not available in Python 3.6, which is the default on Rocky Linux 8. This commit replaces it with `stdout=subprocess.PIPE` and `stderr= subprocess.PIPE` to ensure backward compatibility. This enables `ic-good-opt-*` tests to pass on Rocky 8 environments. See: #1538
1 parent 9b98b82 commit 8d8a3f9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/test/regress/expected/motion_socket.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ for pid in pids_to_check:
4848
# We check count of those connections which have not been established.
4949
# Use the regex for example: "TCP <ip>:\d+ .*" (without '->')
5050
lsof_ret = subprocess.run(["lsof", "-i", "-nP", "-a", "-p", str(pid)],
51-
capture_output=True, check=True).stdout
51+
stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True).stdout
5252
plpy.info(
5353
f'Checking postgres backend {pid}, ' \
5454
f'lsof output:\n{os.linesep.join(map(str, lsof_ret.splitlines()))}')

src/test/regress/sql/motion_socket.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ for pid in pids_to_check:
5050
# We check count of those connections which have not been established.
5151
# Use the regex for example: "TCP <ip>:\d+ .*" (without '->')
5252
lsof_ret = subprocess.run(["lsof", "-i", "-nP", "-a", "-p", str(pid)],
53-
capture_output=True, check=True).stdout
53+
stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True).stdout
5454
plpy.info(
5555
f'Checking postgres backend {pid}, ' \
5656
f'lsof output:\n{os.linesep.join(map(str, lsof_ret.splitlines()))}')

0 commit comments

Comments
 (0)