mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 04:44:28 +08:00
Fix serve long running test (#8268)
This commit is contained in:
committed by
SangBin Cho
parent
f3bed48826
commit
40bb225d7a
@@ -11,6 +11,9 @@ def _callable_accepts_batch(func_or_class):
|
||||
class BackendConfig:
|
||||
def __init__(self, config_dict, accepts_batches=False):
|
||||
assert isinstance(config_dict, dict)
|
||||
# Make a copy so that we don't modify the input dict.
|
||||
config_dict = config_dict.copy()
|
||||
|
||||
self.accepts_batches = accepts_batches
|
||||
self.num_replicas = config_dict.pop("num_replicas", 1)
|
||||
self.max_batch_size = config_dict.pop("max_batch_size", None)
|
||||
|
||||
@@ -9,6 +9,11 @@ def test_backend_config_validation():
|
||||
with pytest.raises(ValueError, match="unknown_key"):
|
||||
BackendConfig({"unknown_key": -1})
|
||||
|
||||
# Test that the input dict isn't modified.
|
||||
config = {"num_replicas": 2}
|
||||
BackendConfig(config)
|
||||
assert len(config) == 1 and config["num_replicas"] == 2
|
||||
|
||||
# Test num_replicas validation.
|
||||
BackendConfig({"num_replicas": 1})
|
||||
with pytest.raises(TypeError):
|
||||
|
||||
Reference in New Issue
Block a user