[router][CI] Clean up imports and prints statements in sgl-router/py_test (#12024)

This commit is contained in:
Chang Su
2025-10-23 11:56:57 -07:00
committed by GitHub
parent 8bd26dd4e6
commit 28b8a4064d
31 changed files with 115 additions and 153 deletions

View File

@@ -2,6 +2,7 @@
Utility functions for Response API e2e tests.
"""
import logging
import os
import signal
import threading
@@ -9,6 +10,8 @@ import unittest
import psutil
logger = logging.getLogger(__name__)
def kill_process_tree(parent_pid, include_parent: bool = True, skip_pid: int = None):
"""
@@ -69,14 +72,10 @@ class CustomTestCase(unittest.TestCase):
return super(CustomTestCase, self)._callTestMethod(method)
except Exception as e:
if attempt < max_retry:
print(
logger.info(
f"Test failed on attempt {attempt + 1}/{max_retry + 1}, retrying..."
)
continue
else:
# Last attempt, re-raise the exception
raise
def setUp(self):
"""Print test method name at the start of each test."""
print(f"[Test Method] {self._testMethodName}", flush=True)