[CI] Graceful teardown in kl_mamba hicache tests to release pinned host pool (#31871)

This commit is contained in:
Alison Shao
2026-07-21 02:09:26 -07:00
committed by GitHub
parent 66ea79dc2e
commit 696e8f80d1
@@ -1,5 +1,6 @@
import os
import shutil
import subprocess
import tempfile
import unittest
@@ -125,6 +126,11 @@ class TestUnifiedMambaHiCache(UnifiedRadixTreeTestMixin, CustomTestCase):
@classmethod
def tearDownClass(cls):
cls.process.terminate()
try:
cls.process.wait(timeout=60)
except subprocess.TimeoutExpired:
pass
kill_process_tree(cls.process.pid)
@@ -186,6 +192,11 @@ class TestUnifiedMambaHiCacheL3(AccuracyTwoPassMixin, CustomTestCase):
@classmethod
def tearDownClass(cls):
cls.process.terminate()
try:
cls.process.wait(timeout=60)
except subprocess.TimeoutExpired:
pass
kill_process_tree(cls.process.pid)
if os.path.isdir(cls.hicache_dir):
shutil.rmtree(cls.hicache_dir, ignore_errors=True)