routing
This commit is contained in:
@@ -288,3 +288,19 @@ def test_proxy_head_is_route_head_and_routing_endpoint_lists_routes():
|
||||
assert len(table["routes"]) == 2
|
||||
sampled = [r for r in table["routes"] if r["samples"] > 0]
|
||||
assert sampled, "completed requests must produce route samples"
|
||||
|
||||
|
||||
def test_endpoint_key_distinguishes_same_port_different_hosts():
|
||||
from meshnet_node.torch_server import _clamp_downstream_hops, _endpoint_key
|
||||
|
||||
assert _endpoint_key("http://192.168.0.20:7000") == "192.168.0.20:7000"
|
||||
assert _endpoint_key("http://192.168.0.179:7000") == "192.168.0.179:7000"
|
||||
assert _endpoint_key("http://192.168.0.20:7000") != _endpoint_key("http://192.168.0.179:7000")
|
||||
|
||||
class Backend:
|
||||
shard_end = 21
|
||||
|
||||
hops = [{"endpoint": "http://192.168.0.179:7000", "start_layer": 0}]
|
||||
assert _clamp_downstream_hops(hops, Backend()) == [
|
||||
{"endpoint": "http://192.168.0.179:7000", "start_layer": 22},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user