Skip to content

Commit

Permalink
fix test_cli_internal_api_background process termination (apache#42773)
Browse files Browse the repository at this point in the history
  • Loading branch information
gopidesupavan authored Oct 6, 2024
1 parent 1cb9294 commit face62b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/cli/commands/test_internal_api_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,13 @@ def test_cli_internal_api_background(self, tmp_path):
"[magenta]Terminating monitor process and expect "
"internal-api and gunicorn processes to terminate as well"
)
internal_api_proc = psutil.Process(pid_internal_api)
internal_api_proc.terminate()
proc = psutil.Process(pid_monitor)
proc.terminate()
assert proc.wait(120) in (0, None)
gone, alive = psutil.wait_procs([internal_api_proc, proc], timeout=120)
for p in alive:
p.kill()
self._check_processes(ignore_running=False)
console.print("[magenta]All internal-api and gunicorn processes are terminated.")
except Exception:
Expand Down

0 comments on commit face62b

Please sign in to comment.