mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 02:00:20 +00:00
Saving debug info for proc and psutil processes which shows difference - psutil.process(pid) doesn't give register function
This commit is contained in:
parent
01a44b41f8
commit
8198500f51
2 changed files with 36 additions and 1 deletions
|
@ -528,11 +528,12 @@ class GitProvider:
|
|||
if HAS_PSUTIL:
|
||||
cur_pid = os.getpid()
|
||||
process = psutil.Process(cur_pid)
|
||||
dgm_process_dir = dir(process)
|
||||
log.warning(
|
||||
f"DGM class GitProvider dunder init, cur_pid '{cur_pid}', process '{process}'"
|
||||
)
|
||||
print(
|
||||
f"DGM class GitProvider dunder init, cur_pid '{cur_pid}', process '{process}'"
|
||||
f"DGM class GitProvider dunder init, cur_pid '{cur_pid}', process '{process}', process dir '{dgm_process_dir}'"
|
||||
)
|
||||
if isinstance(process, salt.utils.process.Process):
|
||||
cache_dir = self.opts.get("cachedir", None)
|
||||
|
|
|
@ -9,6 +9,7 @@ import pathlib
|
|||
import signal
|
||||
import time
|
||||
|
||||
import psutil
|
||||
import pytest
|
||||
from saltfactories.utils import random_string
|
||||
|
||||
|
@ -586,6 +587,39 @@ def test_git_provider_sigterm_cleanup(
|
|||
)
|
||||
print(f"DGM test_git_provider_sigterm_cleanup, post add_process, proc '{proc}'")
|
||||
|
||||
print("DGM test area entry")
|
||||
|
||||
dgm_proc_dir = dir(proc)
|
||||
print(
|
||||
f"DGM test_git_provider_sigterm_cleanup, post add_process, proc '{proc}', proc dir '{dgm_proc_dir}'"
|
||||
)
|
||||
|
||||
dgm_pid = proc.pid
|
||||
print(f"DGM test_git_provider_sigterm_cleanup, proc pid '{proc.pid}'")
|
||||
|
||||
dgm_process = psutil.Process(dgm_pid)
|
||||
print(f"DGM test_git_provider_sigterm_cleanup, psutil process '{dgm_process}'")
|
||||
|
||||
if isinstance(proc, salt.utils.process.Process):
|
||||
print(
|
||||
"DGM test_git_provider_sigterm_cleanup, proc isinstance salt utils process Process is TRUE"
|
||||
)
|
||||
else:
|
||||
print(
|
||||
"DGM test_git_provider_sigterm_cleanup, proc isinstance salt utils process Process is FALSE"
|
||||
)
|
||||
|
||||
if isinstance(dgm_process, salt.utils.process.Process):
|
||||
print(
|
||||
"DGM test_git_provider_sigterm_cleanup, process isinstance salt utils process Process is TRUE"
|
||||
)
|
||||
else:
|
||||
print(
|
||||
"DGM test_git_provider_sigterm_cleanup, process isinstance salt utils process Process is FALSE"
|
||||
)
|
||||
|
||||
print("DGM test area exit")
|
||||
|
||||
procmgr.run(asynchronous=True)
|
||||
|
||||
time.sleep(2) # give some time for it to terminate
|
||||
|
|
Loading…
Add table
Reference in a new issue