test: recover the config-namespace-migration deferrals (#33171)
The module-skipped tests injected config by faking get_server_args (a SimpleNamespace stand-in patched onto the module) or by writing fields onto a ServerArgs instance post-publish — both invisible to the namespace accessors the production code now reads. Re-enable them by publishing the config they need (get_context().override_server_args seeding, scoped per test), asserting bag state where the old assertions checked instance write-through (declare_load_time_override is bag-only), and extending the per-runner stubs the code genuinely reads (kv_cache_dtype_str, max_total_tokens, context_len). The unified-radix-cache file (which grew a large hicache/insert-walk suite while skipped) is recovered in the same change: - test_cache_finished_req_strips_thinking (19 parametrized classes) wrote strip_thinking_cache onto the ServerArgs instance; the cache reads get_serving().strip_thinking_cache — use the serving bag's scoped override. - test_shallower_crossing_backs_up_above_backuped_middle staged its broken-backup-continuity setup through insert_host, which now deliberately drops refills below an un-backed-up node under write-through (host_insert_dropped). Build the same tree state through an explicit backup + device eviction. Every config-namespace-migration deferral is recovered, so the deferral ratchet (test_migration_deferral_ratchet.py) has done its job and is retired.
This commit is contained in:
@@ -17,21 +17,6 @@ from sglang.test.ci.ci_register import register_cpu_ci
|
||||
register_cpu_ci(est_time=10, suite="base-a-test-cpu")
|
||||
|
||||
|
||||
import pytest as _pytest_defer
|
||||
|
||||
_DEFER_REASON = (
|
||||
"Temporarily skipped during the ServerArgs config-namespace migration; "
|
||||
"re-enabled once the runtime-config accessor API stabilizes."
|
||||
)
|
||||
pytestmark = _pytest_defer.mark.skip(reason=_DEFER_REASON)
|
||||
|
||||
|
||||
def setUpModule():
|
||||
import unittest
|
||||
|
||||
raise unittest.SkipTest(_DEFER_REASON)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def mock_cpu_env(kv_size=2, tp_size=1, swa_eviction_interval=4):
|
||||
"""Mock GPU-dependent functions for CPU-only testing.
|
||||
@@ -116,10 +101,12 @@ def _make_model_runner(
|
||||
mc.hf_config = SimpleNamespace(architectures=["LlamaForCausalLM"])
|
||||
mc.hf_config.get_text_config = lambda: mc.hf_config
|
||||
mc.linear_attn_registry_result = None
|
||||
mc.context_len = 8192
|
||||
mr.model_config = mc
|
||||
mr.kv_cache_dtype = "fake_bf16"
|
||||
|
||||
sa = SimpleNamespace()
|
||||
sa.max_total_tokens = None
|
||||
sa.swa_full_tokens_ratio = swa_full_tokens_ratio
|
||||
sa.page_size = page_size
|
||||
sa.disable_radix_cache = disable_radix_cache
|
||||
|
||||
Reference in New Issue
Block a user