[CI] [NPU] precise-test: collect multimodal_gen coverage per test case (#45553)
This commit is contained in:
@@ -30,7 +30,17 @@ _PERFORMANCE_TOLERANCE = 0.25
|
||||
|
||||
def _kill_process_tree(proc: subprocess.Popen) -> None:
|
||||
try:
|
||||
os.killpg(os.getpgid(proc.pid), signal.SIGKILL)
|
||||
pgid = os.getpgid(proc.pid)
|
||||
# Coverage collection can only flush a traced subprocess on a graceful
|
||||
# stop (SIGKILL skips atexit). Give the cluster a SIGTERM head start
|
||||
# when coverage is active, then always escalate to SIGKILL.
|
||||
if os.environ.get("COVERAGE_PROCESS_START"):
|
||||
os.killpg(pgid, signal.SIGTERM)
|
||||
try:
|
||||
proc.wait(timeout=30)
|
||||
except subprocess.TimeoutExpired:
|
||||
pass
|
||||
os.killpg(pgid, signal.SIGKILL)
|
||||
except (ProcessLookupError, PermissionError):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user