chore: use sigkill to kill the process
This commit is contained in:
parent
3d34b30390
commit
e8e1e08a89
|
@ -43,7 +43,7 @@ def kill_process(pid, sig: signal.Signals = signal.SIGKILL):
|
||||||
|
|
||||||
|
|
||||||
@allure.step('Kill process with retries')
|
@allure.step('Kill process with retries')
|
||||||
def kill_process_with_retries(pid, sig: signal.Signals = signal.SIGTERM, attempts: int = 3):
|
def kill_process_with_retries(pid, sig: signal.Signals = signal.SIGKILL, attempts: int = 3):
|
||||||
LOG.debug('Killing process: %d', pid)
|
LOG.debug('Killing process: %d', pid)
|
||||||
try:
|
try:
|
||||||
p = psutil.Process(pid)
|
p = psutil.Process(pid)
|
||||||
|
@ -51,7 +51,7 @@ def kill_process_with_retries(pid, sig: signal.Signals = signal.SIGTERM, attempt
|
||||||
LOG.warning('Process %d already gone.', pid)
|
LOG.warning('Process %d already gone.', pid)
|
||||||
return
|
return
|
||||||
|
|
||||||
p.terminate()
|
p.send_signal(sig)
|
||||||
|
|
||||||
while attempts > 0:
|
while attempts > 0:
|
||||||
attempts -= 1
|
attempts -= 1
|
||||||
|
|
Loading…
Reference in New Issue