Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/cov_pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ addopts =
--ignore=tests/e2e/golang_router
--ignore=tests/v1/test_schedule_output.py
--ignore=tests/graph_optimization/test_cuda_graph_dynamic_subgraph.py
--ignore=tests/distributed/test_communication.py
2 changes: 1 addition & 1 deletion tests/distributed/test_communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_use_custom_allreduce(self, mock_custom_ar, mock_get_hcg):
communication.use_custom_allreduce()

self.assertIsNotNone(communication._TP_AR)
mock_custom_ar.assert_called_once_with(fake_group, 64 * 1024 * 1024)
mock_custom_ar.assert_called_once_with(fake_group, 8 * 1024 * 1024)

def test_custom_ar_clear_ipc_handles(self):
mock_tp_ar = MagicMock()
Expand Down
9 changes: 9 additions & 0 deletions tests/engine/test_async_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@

import asyncio
import os
import sys
import unittest
import uuid
import weakref

sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", ".."))

from e2e.utils.serving_utils import clean_ports

from fastdeploy.engine.args_utils import EngineArgs
from fastdeploy.engine.async_llm import AsyncLLM
from fastdeploy.engine.sampling_params import SamplingParams
Expand All @@ -42,6 +47,10 @@ class TestAsyncLLMEngine(unittest.TestCase):
def setUpClass(cls):
"""Set up AsyncLLM for testing"""
try:
# Clean ports before starting the engine
print("Pre-test port cleanup...")
clean_ports()

# Use unique ports to avoid conflicts
base_port = int(os.getenv("FD_ENGINE_QUEUE_PORT", "6778"))
cache_port = int(os.getenv("FD_CACHE_QUEUE_PORT", "6779"))
Expand Down
8 changes: 8 additions & 0 deletions tests/engine/test_common_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@

import asyncio
import os
import sys
import threading
import time
import types
import unittest
from unittest.mock import ANY, AsyncMock, MagicMock, Mock, patch

sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", ".."))

import numpy as np
import paddle
from e2e.utils.serving_utils import clean_ports

if not hasattr(paddle, "compat"):

Expand Down Expand Up @@ -82,6 +86,10 @@ class TestCommonEngine(unittest.TestCase):
def setUpClass(cls):
"""Set up EngineService for testing"""
try:
# Clean ports before starting the engine
print("Pre-test port cleanup...")
clean_ports()

# Create engine args for testing
engine_args = EngineArgs(
model=MODEL_NAME,
Expand Down
7 changes: 7 additions & 0 deletions tests/engine/test_resource_manager_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@
# limitations under the License.

import os
import sys
import unittest
from unittest.mock import Mock

from fastdeploy.engine.args_utils import EngineArgs
from fastdeploy.engine.request import Request, RequestStatus
from fastdeploy.engine.sched.resource_manager_v1 import ResourceManagerV1

sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", ".."))
from e2e.utils.serving_utils import clean_ports

MODEL_NAME = os.getenv("MODEL_PATH", "/path/to/models") + "/ERNIE-4.5-0.3B-Paddle"


Expand All @@ -28,6 +32,9 @@ class TestResourceManagerV1(unittest.TestCase):

def setUp(self):
"""Set up test fixtures."""
# Clean ports before each test
clean_ports()

engine_args = EngineArgs(
model=MODEL_NAME,
max_model_len=8192,
Expand Down
Loading