[CI] Fix test suite names and add suite validation (#21937)
This commit is contained in:
@@ -24,7 +24,7 @@ from sglang.srt.utils.watchdog import SubprocessWatchdog
|
||||
from sglang.test.ci.ci_register import register_cpu_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cpu_ci(est_time=10, suite="stage-a-cpu-only")
|
||||
register_cpu_ci(est_time=10, suite="stage-a-test-cpu")
|
||||
|
||||
|
||||
def healthy_worker():
|
||||
@@ -40,6 +40,10 @@ def slow_crash_worker(delay: float = 0.5):
|
||||
os._exit(42)
|
||||
|
||||
|
||||
def noop_worker():
|
||||
pass
|
||||
|
||||
|
||||
class TestSubprocessWatchdog(CustomTestCase):
|
||||
def setUp(self):
|
||||
self.sigquit_triggered = threading.Event()
|
||||
@@ -93,7 +97,7 @@ class TestSubprocessWatchdog(CustomTestCase):
|
||||
proc = self._spawn(slow_crash_worker, args=(0.2,))
|
||||
self._watch(proc)
|
||||
self.assertTrue(
|
||||
self.sigquit_triggered.wait(timeout=2.0),
|
||||
self.sigquit_triggered.wait(timeout=5.0),
|
||||
"SIGQUIT was not triggered within timeout",
|
||||
)
|
||||
|
||||
@@ -101,7 +105,7 @@ class TestSubprocessWatchdog(CustomTestCase):
|
||||
proc = self._spawn(crashing_worker)
|
||||
self._watch(proc, interval=0.05)
|
||||
self.assertTrue(
|
||||
self.sigquit_triggered.wait(timeout=1.0),
|
||||
self.sigquit_triggered.wait(timeout=5.0),
|
||||
"Immediate crash was not detected",
|
||||
)
|
||||
|
||||
@@ -110,7 +114,7 @@ class TestSubprocessWatchdog(CustomTestCase):
|
||||
crashing = self._spawn(slow_crash_worker, args=(0.2,))
|
||||
self._watch([healthy, crashing], names=["healthy", "crashing"])
|
||||
self.assertTrue(
|
||||
self.sigquit_triggered.wait(timeout=2.0),
|
||||
self.sigquit_triggered.wait(timeout=5.0),
|
||||
"Crash was not detected when one of multiple processes crashed",
|
||||
)
|
||||
|
||||
@@ -120,7 +124,7 @@ class TestSubprocessWatchdog(CustomTestCase):
|
||||
self.assertFalse(self.sigquit_triggered.is_set())
|
||||
|
||||
def test_normal_exit_no_sigquit(self):
|
||||
proc = self._spawn(lambda: None)
|
||||
proc = self._spawn(noop_worker)
|
||||
proc.join(timeout=2)
|
||||
self._watch(proc)
|
||||
time.sleep(0.3)
|
||||
@@ -131,7 +135,6 @@ class TestSubprocessWatchdog(CustomTestCase):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
mp.set_start_method("spawn", force=True)
|
||||
import unittest
|
||||
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user