Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
15ddd843
Unverified
Commit
15ddd843
authored
Mar 26, 2025
by
fzyzcjy
Committed by
GitHub
Mar 25, 2025
Browse files
Add retry for flaky tests in CI (#4755)
parent
52029bd1
Changes
112
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
43 additions
and
26 deletions
+43
-26
test/srt/test_penalty.py
test/srt/test_penalty.py
+2
-1
test/srt/test_pytorch_sampling_backend.py
test/srt/test_pytorch_sampling_backend.py
+2
-1
test/srt/test_radix_attention.py
test/srt/test_radix_attention.py
+2
-1
test/srt/test_reasoning_content.py
test/srt/test_reasoning_content.py
+3
-2
test/srt/test_regex_constrained.py
test/srt/test_regex_constrained.py
+2
-1
test/srt/test_release_memory_occupation.py
test/srt/test_release_memory_occupation.py
+2
-2
test/srt/test_request_length_validation.py
test/srt/test_request_length_validation.py
+2
-1
test/srt/test_retract_decode.py
test/srt/test_retract_decode.py
+3
-2
test/srt/test_sagemaker_server.py
test/srt/test_sagemaker_server.py
+2
-1
test/srt/test_schedule_policy.py
test/srt/test_schedule_policy.py
+2
-1
test/srt/test_server_args.py
test/srt/test_server_args.py
+2
-1
test/srt/test_session_control.py
test/srt/test_session_control.py
+3
-2
test/srt/test_skip_tokenizer_init.py
test/srt/test_skip_tokenizer_init.py
+2
-1
test/srt/test_srt_endpoint.py
test/srt/test_srt_endpoint.py
+2
-1
test/srt/test_srt_engine.py
test/srt/test_srt_engine.py
+2
-1
test/srt/test_srt_engine_with_quant_args.py
test/srt/test_srt_engine_with_quant_args.py
+2
-2
test/srt/test_torch_compile.py
test/srt/test_torch_compile.py
+2
-1
test/srt/test_torch_compile_moe.py
test/srt/test_torch_compile_moe.py
+2
-1
test/srt/test_torch_native_attention_backend.py
test/srt/test_torch_native_attention_backend.py
+2
-1
test/srt/test_torch_tp.py
test/srt/test_torch_tp.py
+2
-2
No files found.
test/srt/test_penalty.py
View file @
15ddd843
...
...
@@ -10,11 +10,12 @@ from sglang.test.test_utils import (
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
popen_launch_server
,
)
class
TestPenalty
(
unittest
.
TestCase
):
class
TestPenalty
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
...
...
test/srt/test_pytorch_sampling_backend.py
View file @
15ddd843
...
...
@@ -9,11 +9,12 @@ from sglang.test.test_utils import (
DEFAULT_MODEL_NAME_FOR_TEST
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
popen_launch_server
,
)
class
TestPyTorchSamplingBackend
(
unittest
.
TestCase
):
class
TestPyTorchSamplingBackend
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
model
=
DEFAULT_MODEL_NAME_FOR_TEST
...
...
test/srt/test_radix_attention.py
View file @
15ddd843
...
...
@@ -8,6 +8,7 @@ from sglang.test.test_utils import (
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
kill_process_tree
,
popen_launch_server
,
)
...
...
@@ -59,7 +60,7 @@ def run_test(base_url, nodes):
assert
res
.
status_code
==
200
class
TestRadixCacheFCFS
(
unittest
.
TestCase
):
class
TestRadixCacheFCFS
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
model
=
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
...
...
test/srt/test_reasoning_content.py
View file @
15ddd843
...
...
@@ -20,11 +20,12 @@ from sglang.test.test_utils import (
DEFAULT_REASONING_MODEL_NAME_FOR_TEST
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
popen_launch_server
,
)
class
TestReasoningContentAPI
(
unittest
.
TestCase
):
class
TestReasoningContentAPI
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
model
=
DEFAULT_REASONING_MODEL_NAME_FOR_TEST
...
...
@@ -181,7 +182,7 @@ class TestReasoningContentAPI(unittest.TestCase):
assert
len
(
response
.
choices
[
0
].
message
.
content
)
>
0
class
TestReasoningContentWithoutParser
(
unittest
.
TestCase
):
class
TestReasoningContentWithoutParser
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
model
=
DEFAULT_REASONING_MODEL_NAME_FOR_TEST
...
...
test/srt/test_regex_constrained.py
View file @
15ddd843
...
...
@@ -15,6 +15,7 @@ from sglang.test.test_utils import (
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
popen_launch_server
,
)
...
...
@@ -41,7 +42,7 @@ def setup_class(cls, backend: str, disable_overlap: bool):
)
class
TestRegexConstrained
(
unittest
.
TestCase
):
class
TestRegexConstrained
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
setup_class
(
cls
,
"xgrammar"
,
disable_overlap
=
False
)
...
...
test/srt/test_release_memory_occupation.py
View file @
15ddd843
...
...
@@ -5,13 +5,13 @@ import torch
from
transformers
import
AutoModelForCausalLM
import
sglang
as
sgl
from
sglang.test.test_utils
import
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
from
sglang.test.test_utils
import
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
,
CustomTestCase
# (temporarily) set to true to observe memory usage in nvidia-smi more clearly
_DEBUG_EXTRA
=
True
class
TestReleaseMemoryOccupation
(
unittest
.
TestCase
):
class
TestReleaseMemoryOccupation
(
Custom
TestCase
):
def
test_release_and_resume_occupation
(
self
):
prompt
=
"Today is a sunny day and I like"
sampling_params
=
{
"temperature"
:
0
,
"max_new_tokens"
:
8
}
...
...
test/srt/test_request_length_validation.py
View file @
15ddd843
...
...
@@ -7,11 +7,12 @@ from sglang.test.test_utils import (
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
popen_launch_server
,
)
class
TestRequestLengthValidation
(
unittest
.
TestCase
):
class
TestRequestLengthValidation
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
base_url
=
DEFAULT_URL_FOR_TEST
...
...
test/srt/test_retract_decode.py
View file @
15ddd843
...
...
@@ -8,11 +8,12 @@ from sglang.test.test_utils import (
DEFAULT_MODEL_NAME_FOR_TEST
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
popen_launch_server
,
)
class
TestRetractDecode
(
unittest
.
TestCase
):
class
TestRetractDecode
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
os
.
environ
[
"SGLANG_TEST_RETRACT"
]
=
"1"
...
...
@@ -40,7 +41,7 @@ class TestRetractDecode(unittest.TestCase):
self
.
assertGreaterEqual
(
metrics
[
"score"
],
0.65
)
class
TestRetractDecodeChunkCache
(
unittest
.
TestCase
):
class
TestRetractDecodeChunkCache
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
os
.
environ
[
"SGLANG_TEST_RETRACT"
]
=
"1"
...
...
test/srt/test_sagemaker_server.py
View file @
15ddd843
...
...
@@ -13,11 +13,12 @@ from sglang.test.test_utils import (
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
popen_launch_server
,
)
class
TestSageMakerServer
(
unittest
.
TestCase
):
class
TestSageMakerServer
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
model
=
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
...
...
test/srt/test_schedule_policy.py
View file @
15ddd843
...
...
@@ -8,9 +8,10 @@ from sglang.srt.managers.schedule_policy import (
)
from
sglang.srt.mem_cache.radix_cache
import
RadixCache
,
TreeNode
from
sglang.srt.sampling.sampling_params
import
SamplingParams
from
sglang.test.test_utils
import
CustomTestCase
class
TestSchedulePolicy
(
unittest
.
TestCase
):
class
TestSchedulePolicy
(
Custom
TestCase
):
def
setUp
(
self
):
self
.
tree_cache
=
RadixCache
(
None
,
None
,
False
)
...
...
test/srt/test_server_args.py
View file @
15ddd843
...
...
@@ -2,9 +2,10 @@ import json
import
unittest
from
sglang.srt.server_args
import
prepare_server_args
from
sglang.test.test_utils
import
CustomTestCase
class
TestPrepareServerArgs
(
unittest
.
TestCase
):
class
TestPrepareServerArgs
(
Custom
TestCase
):
def
test_prepare_server_args
(
self
):
server_args
=
prepare_server_args
(
[
...
...
test/srt/test_session_control.py
View file @
15ddd843
...
...
@@ -19,6 +19,7 @@ from sglang.test.test_utils import (
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
popen_launch_server
,
)
...
...
@@ -27,7 +28,7 @@ def remove_prefix(text: str, prefix: str) -> str:
return
text
[
len
(
prefix
)
:]
if
text
.
startswith
(
prefix
)
else
text
class
TestSessionControl
(
unittest
.
TestCase
):
class
TestSessionControl
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
model
=
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
...
...
@@ -560,7 +561,7 @@ class TestSessionControl(unittest.TestCase):
)
class
TestSessionControlVision
(
unittest
.
TestCase
):
class
TestSessionControlVision
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
model
=
"lmms-lab/llava-onevision-qwen2-7b-ov"
...
...
test/srt/test_skip_tokenizer_init.py
View file @
15ddd843
...
...
@@ -19,11 +19,12 @@ from sglang.test.test_utils import (
DEFAULT_SMALL_VLM_MODEL_NAME
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
popen_launch_server
,
)
class
TestSkipTokenizerInit
(
unittest
.
TestCase
):
class
TestSkipTokenizerInit
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
model
=
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
...
...
test/srt/test_srt_endpoint.py
View file @
15ddd843
...
...
@@ -20,12 +20,13 @@ from sglang.test.test_utils import (
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
popen_launch_server
,
run_logprob_check
,
)
class
TestSRTEndpoint
(
unittest
.
TestCase
):
class
TestSRTEndpoint
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
model
=
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
...
...
test/srt/test_srt_engine.py
View file @
15ddd843
...
...
@@ -18,10 +18,11 @@ from sglang.test.few_shot_gsm8k_engine import run_eval
from
sglang.test.test_utils
import
(
DEFAULT_SMALL_EMBEDDING_MODEL_NAME_FOR_TEST
,
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
,
CustomTestCase
,
)
class
TestSRTEngine
(
unittest
.
TestCase
):
class
TestSRTEngine
(
Custom
TestCase
):
def
test_1_engine_runtime_consistency
(
self
):
prompt
=
"Today is a sunny day and I like"
...
...
test/srt/test_srt_engine_with_quant_args.py
View file @
15ddd843
import
unittest
import
sglang
as
sgl
from
sglang.test.test_utils
import
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
from
sglang.test.test_utils
import
DEFAULT_SMALL_MODEL_NAME_FOR_TEST
,
CustomTestCase
class
TestSRTEngineWithQuantArgs
(
unittest
.
TestCase
):
class
TestSRTEngineWithQuantArgs
(
Custom
TestCase
):
def
test_1_quantization_args
(
self
):
...
...
test/srt/test_torch_compile.py
View file @
15ddd843
...
...
@@ -10,11 +10,12 @@ from sglang.test.test_utils import (
DEFAULT_MODEL_NAME_FOR_TEST
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
popen_launch_server
,
)
class
TestTorchCompile
(
unittest
.
TestCase
):
class
TestTorchCompile
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
model
=
DEFAULT_MODEL_NAME_FOR_TEST
...
...
test/srt/test_torch_compile_moe.py
View file @
15ddd843
...
...
@@ -10,11 +10,12 @@ from sglang.test.test_utils import (
DEFAULT_SMALL_MOE_MODEL_NAME_FOR_TEST
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
popen_launch_server
,
)
class
TestTorchCompileMoe
(
unittest
.
TestCase
):
class
TestTorchCompileMoe
(
Custom
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
model
=
DEFAULT_SMALL_MOE_MODEL_NAME_FOR_TEST
...
...
test/srt/test_torch_native_attention_backend.py
View file @
15ddd843
...
...
@@ -12,13 +12,14 @@ from sglang.test.test_utils import (
DEFAULT_MODEL_NAME_FOR_TEST
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
is_in_ci
,
popen_launch_server
,
run_bench_one_batch
,
)
class
TestTorchNativeAttnBackend
(
unittest
.
TestCase
):
class
TestTorchNativeAttnBackend
(
Custom
TestCase
):
def
test_latency
(
self
):
output_throughput
=
run_bench_one_batch
(
DEFAULT_MODEL_NAME_FOR_TEST
,
...
...
test/srt/test_torch_tp.py
View file @
15ddd843
import
unittest
from
sglang.test.test_utils
import
is_in_ci
,
run_bench_one_batch
from
sglang.test.test_utils
import
CustomTestCase
,
is_in_ci
,
run_bench_one_batch
class
TestTorchTP
(
unittest
.
TestCase
):
class
TestTorchTP
(
Custom
TestCase
):
def
test_torch_native_llama
(
self
):
output_throughput
=
run_bench_one_batch
(
"meta-llama/Meta-Llama-3-8B"
,
...
...
Prev
1
2
3
4
5
6
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment