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

Updating of CI-tests#197

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
Changes from2 commits
Commits
Show all changes
47 commits
Select commitHold shift + click to select a range
7d8302f
Test dockerfile for ubuntu 24.04 is added
dmitry-lipetskFeb 26, 2025
2df2fd4
Cleanup (Dockerfile--ubuntu-24_04)
dmitry-lipetskFeb 26, 2025
e8bf7d6
Cleanup.
dmitry-lipetskFeb 27, 2025
103bcd2
[run_tests.sh] A right way for obtaining of BINDIR and PG_CONFIG is …
dmitry-lipetskFeb 27, 2025
d0eb414
Merge remote-tracking branch 'origin/D20250227_001--pg_config-bindir'…
dmitry-lipetskFeb 27, 2025
579d20e
Dockerfile--ubuntu-24_04 is updated
dmitry-lipetskFeb 27, 2025
e87c402
Dockerfile--ubuntu-24_04 is updated (cleanup)
dmitry-lipetskFeb 27, 2025
b88327d
Merge commit '9911ed0c928b602c17a3b0845b24910bf291925a' into D2025022…
dmitry-lipetskFeb 27, 2025
126b5a8
Merge commit '6d67da2170becb944fc768ff4938f88b37e0f2a4' into D2025022…
dmitry-lipetskFeb 27, 2025
96227f5
Dockerfile--ubuntu-24_04 is updated (cleanup)
dmitry-lipetskFeb 27, 2025
b7bf713
Dockerfile--ubuntu-24_04 is formatted
dmitry-lipetskFeb 27, 2025
bcb7771
CI-test on Ubuntu 24.04 is added.
dmitry-lipetskFeb 27, 2025
7d871a2
Dockerfile--std.tmpl is updated (refactoring)
dmitry-lipetskFeb 27, 2025
381d64d
Dockerfile--ubuntu-24_04.tmpl is updated
dmitry-lipetskFeb 27, 2025
b5c4d7b
PostgresNode::pid is improved
dmitry-lipetskFeb 27, 2025
fce595a
PostgresNode::pid is updated
dmitry-lipetskFeb 27, 2025
a92a6e7
Merge remote-tracking branch 'origin/D20250227_001--node-pid' into D2…
dmitry-lipetskFeb 27, 2025
0aebc00
Merge branch 'master' into D20250227_001--node-pid
dmitry-lipetskFeb 28, 2025
ebd6208
Merge branch 'master' into D20250226_001--ci_and_ssh
dmitry-lipetskFeb 28, 2025
0863cf5
execute_utility2 is updated (ignore_errors)
dmitry-lipetskFeb 28, 2025
a4e65bf
Merge branch 'D20250228_001--execute_utility2' into D20250227_001--no…
dmitry-lipetskFeb 28, 2025
09976ae
PostgresNode::_try_shutdown is rewrited (normalization)
dmitry-lipetskFeb 28, 2025
ab28c2e
Merge branch '20250228_002--try_shutdown' into D20250227_001--node-pid
dmitry-lipetskFeb 28, 2025
0402c4a
PostgresNode::pid uses the data from "pg_ctl status" output.
dmitry-lipetskFeb 28, 2025
c288af8
Merge remote-tracking branch 'origin/D20250227_001--node-pid' into D2…
dmitry-lipetskFeb 28, 2025
45d2b17
PostgresNode::_try_shutdown is correct (return None)
dmitry-lipetskFeb 28, 2025
a960ac7
Merge branch '20250228_002--try_shutdown' into D20250227_001--node-pid
dmitry-lipetskFeb 28, 2025
5c6548f
Merge remote-tracking branch 'origin/D20250227_001--node-pid' into D2…
dmitry-lipetskFeb 28, 2025
619fefa
[RemoteOperations] A call of mktemp is fixed
dmitry-lipetskFeb 28, 2025
015b766
Merge remote-tracking branch 'origin/D20250228_001--remote-mktemp' in…
dmitry-lipetskFeb 28, 2025
82981f5
Merge branch 'master' into D20250227_001--node-pid
dmitry-lipetskMar 1, 2025
61d8929
Merge remote-tracking branch 'origin/D20250227_001--node-pid' into D2…
dmitry-lipetskMar 1, 2025
3c2b51f
Merge branch 'master' into D20250226_001--ci_and_ssh
dmitry-lipetskMar 1, 2025
76e9c53
Merge branch 'master' into D20250226_001--ci_and_ssh
dmitry-lipetskMar 1, 2025
1309442
Total refactoring of os_ops::execute_command
dmitry-lipetskMar 1, 2025
9b7c10e
Merge remote-tracking branch 'origin/D20250301_01--os_ops-exec_comman…
dmitry-lipetskMar 1, 2025
e245e23
Dockerfile--ubuntu-24_04.tmpl is updated
dmitry-lipetskMar 1, 2025
d843df6
The old behaviour of RaiseError.UtilityExitedWithNonZeroCode is restored
dmitry-lipetskMar 1, 2025
afb4a3d
Merge remote-tracking branch 'origin/D20250301_01--os_ops-exec_comman…
dmitry-lipetskMar 1, 2025
25c7c0f
TestRemoteOperations::test_is_executable_true is corrected
dmitry-lipetskMar 1, 2025
c4cbaf3
Merge branch 'D20250301_002--remote_ops_tests-test_is_executable_true…
dmitry-lipetskMar 1, 2025
491b693
Merge branch 'master' into D20250226_001--ci_and_ssh
dmitry-lipetskMar 1, 2025
5cec260
xxx::test_logging is corrected (local, remote)
dmitry-lipetskMar 2, 2025
6a70944
Merge remote-tracking branch 'origin/D20250302_001--test_logging' int…
dmitry-lipetskMar 2, 2025
d15e29c
TEST_FILTER is added
dmitry-lipetskMar 2, 2025
9329f22
CI on Ubuntu 24.04 runs all the tests
dmitry-lipetskMar 2, 2025
62ae15c
Merge branch 'master' into D20250226_001--ci_and_ssh
dmitry-lipetskMar 2, 2025
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
107 changes: 75 additions & 32 deletionstestgres/node.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -367,41 +367,84 @@ def version(self):
return self._pg_version

def _try_shutdown(self, max_attempts, with_force=False):
assert type(max_attempts) == int # noqa: E721
assert type(with_force) == bool # noqa: E721
assert max_attempts > 0

attempts = 0

# try stopping server N times
while attempts < max_attempts:
attempts += 1
try:
self.stop()
except ExecUtilException:
continue # one more time
except Exception:
eprint('cannot stop node {}'.format(self.name))
break

return # OK

# If force stopping is enabled and PID is valid
if not with_force:
return False

node_pid = self.pid
assert node_pid is not None
assert type(node_pid) == int # noqa: E721

if node_pid > 0:
# try stopping server N times
while attempts < max_attempts:
try:
self.stop()
break # OK
except ExecUtilException:
pass # one more time
except Exception:
eprint('cannot stop node {}'.format(self.name))
break

attempts += 1

# If force stopping is enabled and PID is valid
if with_force and node_pid != 0:
# If we couldn't stop the node
p_status_output = self.os_ops.exec_command(cmd=f'ps -o pid= -p {node_pid}', shell=True, ignore_errors=True).decode('utf-8')
if self.status() != NodeStatus.Stopped and p_status_output and str(node_pid) in p_status_output:
try:
eprint(f'Force stopping node {self.name} with PID {node_pid}')
self.os_ops.kill(node_pid, signal.SIGKILL, expect_error=False)
except Exception:
# The node has already stopped
pass

# Check that node stopped - print only column pid without headers
p_status_output = self.os_ops.exec_command(f'ps -o pid= -p {node_pid}', shell=True, ignore_errors=True).decode('utf-8')
if p_status_output and str(node_pid) in p_status_output:
eprint(f'Failed to stop node {self.name}.')
else:
eprint(f'Node {self.name} has been stopped successfully.')
if node_pid == 0:
return

# TODO: [2025-02-28] It is really the old ugly code. We have to rewrite it!

ps_command = ['ps', '-o', 'pid=', '-p', str(node_pid)]

ps_output = self.os_ops.exec_command(cmd=ps_command, shell=True, ignore_errors=True).decode('utf-8')
assert type(ps_output) == str # noqa: E721

if ps_output == "":
return

if ps_output != str(node_pid):
__class__._throw_bugcheck__unexpected_result_of_ps(
ps_output,
ps_command)

try:
eprint('Force stopping node {0} with PID {1}'.format(self.name, node_pid))
self.os_ops.kill(node_pid, signal.SIGKILL, expect_error=False)
except Exception:
# The node has already stopped
pass

# Check that node stopped - print only column pid without headers
ps_output = self.os_ops.exec_command(cmd=ps_command, shell=True, ignore_errors=True).decode('utf-8')
assert type(ps_output) == str # noqa: E721

if ps_output == "":
eprint('Node {0} has been stopped successfully.'.format(self.name))
return

if ps_output == str(node_pid):
eprint('Failed to stop node {0}.'.format(self.name))
return

__class__._throw_bugcheck__unexpected_result_of_ps(
ps_output,
ps_command)

@staticmethod
def _throw_bugcheck__unexpected_result_of_ps(result, cmd):
assert type(result) == str # noqa: E721
assert type(cmd) == list # noqa: E721
errLines = []
errLines.append("[BUG CHECK] Unexpected result of command ps:")
errLines.append(result)
errLines.append("-----")
errLines.append("Command line is {0}".format(cmd))
raise RuntimeError("\n".join(errLines))

def _assign_master(self, master):
"""NOTE: this is a private method!"""
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp