Unverified Commit d4fc1a70 authored by Lianmin Zheng's avatar Lianmin Zheng Committed by GitHub
Browse files

Crash the server correctly during error (#2231)

parent db674e3d
...@@ -4,7 +4,7 @@ from types import SimpleNamespace ...@@ -4,7 +4,7 @@ from types import SimpleNamespace
import requests import requests
from sglang.srt.utils import kill_child_process from sglang.srt.utils import kill_process_tree
from sglang.test.run_eval import run_eval from sglang.test.run_eval import run_eval
from sglang.test.test_utils import ( from sglang.test.test_utils import (
DEFAULT_MODEL_NAME_FOR_TEST, DEFAULT_MODEL_NAME_FOR_TEST,
...@@ -28,7 +28,7 @@ class TestTorchCompile(unittest.TestCase): ...@@ -28,7 +28,7 @@ class TestTorchCompile(unittest.TestCase):
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
kill_child_process(cls.process.pid, include_self=True) kill_process_tree(cls.process.pid)
def test_mmlu(self): def test_mmlu(self):
args = SimpleNamespace( args = SimpleNamespace(
......
...@@ -4,7 +4,7 @@ from types import SimpleNamespace ...@@ -4,7 +4,7 @@ from types import SimpleNamespace
import requests import requests
from sglang.srt.utils import kill_child_process from sglang.srt.utils import kill_process_tree
from sglang.test.run_eval import run_eval from sglang.test.run_eval import run_eval
from sglang.test.test_utils import ( from sglang.test.test_utils import (
DEFAULT_SMALL_MOE_MODEL_NAME_FOR_TEST, DEFAULT_SMALL_MOE_MODEL_NAME_FOR_TEST,
...@@ -28,7 +28,7 @@ class TestTorchCompile(unittest.TestCase): ...@@ -28,7 +28,7 @@ class TestTorchCompile(unittest.TestCase):
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
kill_child_process(cls.process.pid, include_self=True) kill_process_tree(cls.process.pid)
def test_mmlu(self): def test_mmlu(self):
args = SimpleNamespace( args = SimpleNamespace(
......
...@@ -3,7 +3,7 @@ from types import SimpleNamespace ...@@ -3,7 +3,7 @@ from types import SimpleNamespace
import requests import requests
from sglang.srt.utils import kill_child_process from sglang.srt.utils import kill_process_tree
from sglang.test.run_eval import run_eval from sglang.test.run_eval import run_eval
from sglang.test.test_utils import ( from sglang.test.test_utils import (
DEFAULT_MODEL_NAME_FOR_TEST, DEFAULT_MODEL_NAME_FOR_TEST,
...@@ -27,7 +27,7 @@ class TestTorchAO(unittest.TestCase): ...@@ -27,7 +27,7 @@ class TestTorchAO(unittest.TestCase):
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
kill_child_process(cls.process.pid, include_self=True) kill_process_tree(cls.process.pid)
def test_mmlu(self): def test_mmlu(self):
args = SimpleNamespace( args = SimpleNamespace(
......
...@@ -6,7 +6,7 @@ python3 -m unittest test_triton_attention_backend.TestTritonAttnBackend.test_mml ...@@ -6,7 +6,7 @@ python3 -m unittest test_triton_attention_backend.TestTritonAttnBackend.test_mml
import unittest import unittest
from types import SimpleNamespace from types import SimpleNamespace
from sglang.srt.utils import kill_child_process from sglang.srt.utils import kill_process_tree
from sglang.test.run_eval import run_eval from sglang.test.run_eval import run_eval
from sglang.test.test_utils import ( from sglang.test.test_utils import (
DEFAULT_MODEL_NAME_FOR_TEST, DEFAULT_MODEL_NAME_FOR_TEST,
...@@ -54,7 +54,7 @@ class TestTritonAttnBackend(unittest.TestCase): ...@@ -54,7 +54,7 @@ class TestTritonAttnBackend(unittest.TestCase):
metrics = run_eval(args) metrics = run_eval(args)
self.assertGreaterEqual(metrics["score"], 0.65) self.assertGreaterEqual(metrics["score"], 0.65)
finally: finally:
kill_child_process(process.pid, include_self=True) kill_process_tree(process.pid)
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -3,7 +3,7 @@ import unittest ...@@ -3,7 +3,7 @@ import unittest
import requests import requests
from sglang.srt.utils import kill_child_process from sglang.srt.utils import kill_process_tree
from sglang.test.test_utils import ( from sglang.test.test_utils import (
DEFAULT_SMALL_MODEL_NAME_FOR_TEST, DEFAULT_SMALL_MODEL_NAME_FOR_TEST,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
...@@ -23,7 +23,7 @@ class TestUpdateWeights(unittest.TestCase): ...@@ -23,7 +23,7 @@ class TestUpdateWeights(unittest.TestCase):
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
kill_child_process(cls.process.pid, include_self=True) kill_process_tree(cls.process.pid)
def run_decode(self): def run_decode(self):
response = requests.post( response = requests.post(
......
...@@ -17,7 +17,7 @@ import requests ...@@ -17,7 +17,7 @@ import requests
from decord import VideoReader, cpu from decord import VideoReader, cpu
from PIL import Image from PIL import Image
from sglang.srt.utils import kill_child_process from sglang.srt.utils import kill_process_tree
from sglang.test.test_utils import ( from sglang.test.test_utils import (
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
DEFAULT_URL_FOR_TEST, DEFAULT_URL_FOR_TEST,
...@@ -46,7 +46,7 @@ class TestOpenAIVisionServer(unittest.TestCase): ...@@ -46,7 +46,7 @@ class TestOpenAIVisionServer(unittest.TestCase):
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
kill_child_process(cls.process.pid, include_self=True) kill_process_tree(cls.process.pid)
def test_chat_completion(self): def test_chat_completion(self):
client = openai.Client(api_key=self.api_key, base_url=self.base_url) client = openai.Client(api_key=self.api_key, base_url=self.base_url)
...@@ -387,7 +387,7 @@ class TestQWen2VLServerContextLengthIssue(unittest.TestCase): ...@@ -387,7 +387,7 @@ class TestQWen2VLServerContextLengthIssue(unittest.TestCase):
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
kill_child_process(cls.process.pid, include_self=True) kill_process_tree(cls.process.pid)
def test_chat_completion(self): def test_chat_completion(self):
client = openai.Client(api_key=self.api_key, base_url=self.base_url) client = openai.Client(api_key=self.api_key, base_url=self.base_url)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment