[verified] feat: complete Ralph task workstreams
This commit is contained in:
@@ -26,6 +26,10 @@ from meshnet_node.startup import (
|
||||
_tracker_http_error_message,
|
||||
run_startup,
|
||||
)
|
||||
# Startup admits a node only on a capability report from a real forward, which a
|
||||
# fake backend cannot perform. These tests say so explicitly rather than bypassing
|
||||
# admission; the fail-closed path itself is covered in tests/test_node_admission.py.
|
||||
from meshnet_node.testing import assume_capability
|
||||
from meshnet_node.wallet import _b58encode, load_or_create_wallet
|
||||
from meshnet_contracts import LocalSolanaContracts
|
||||
from meshnet_tracker.server import TrackerServer
|
||||
@@ -333,6 +337,7 @@ def test_benchmark_throughput_is_registered_in_payload(monkeypatch, tmp_path):
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
torch_threads=8,
|
||||
torch_interop_threads=1,
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
node.stop()
|
||||
|
||||
@@ -394,6 +399,7 @@ def test_real_model_startup_passes_download_dir_and_kimi_metadata(monkeypatch, t
|
||||
shard_end=60,
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
cache_dir=cache_dir,
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
node.stop()
|
||||
|
||||
@@ -448,6 +454,7 @@ def test_cuda_benchmark_failure_is_registered_for_inventory_only_gpu(monkeypatch
|
||||
shard_start=0,
|
||||
shard_end=23,
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
node.stop()
|
||||
|
||||
@@ -1164,6 +1171,7 @@ def test_public_https_tracker_infers_relay_when_network_map_omits_relay_url(
|
||||
model_id="Qwen/Qwen2.5-0.5B-Instruct",
|
||||
advertise_host="172.29.104.23",
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
pass
|
||||
@@ -1216,6 +1224,7 @@ def test_real_model_startup_summary_shows_total_layers(tmp_path, monkeypatch, ca
|
||||
vram_mb_override=6144,
|
||||
max_loaded_shards=2,
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
|
||||
assert node.backend.total_layers == 24
|
||||
@@ -1275,6 +1284,7 @@ def test_real_model_startup_autodetects_cpu_memory_budget_and_logs_shard_budget(
|
||||
shard_start=0,
|
||||
shard_end=23,
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
pass
|
||||
@@ -1359,6 +1369,7 @@ def test_public_tracker_model_node_registers_relay_metadata_from_tracker_url_onl
|
||||
tracker_url=tracker_url,
|
||||
model_id="Qwen/Qwen2.5-0.5B-Instruct",
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
network_map = _get_json(f"{tracker_url}/v1/network/map")
|
||||
@@ -1444,6 +1455,7 @@ def test_public_tracker_relay_suppresses_virtual_ip_warning(
|
||||
model_id="Qwen/Qwen2.5-0.5B-Instruct",
|
||||
advertise_host="172.29.104.23",
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
network_map = _get_json(f"{tracker_url}/v1/network/map")
|
||||
@@ -1523,6 +1535,7 @@ def test_later_node_auto_joins_existing_public_hf_model_with_only_tracker_url(
|
||||
tracker_url=tracker_url,
|
||||
advertise_host="203.0.113.21",
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
route_resp = _get_json(
|
||||
@@ -1607,6 +1620,7 @@ def test_later_node_auto_joins_redundant_copy_when_model_is_fully_covered(
|
||||
tracker_url=tracker_url,
|
||||
advertise_host="203.0.113.32",
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
assert captured["model_id"] == "Qwen/Qwen2.5-0.5B-Instruct"
|
||||
@@ -1637,6 +1651,7 @@ def test_full_startup_sequence(tmp_path):
|
||||
model="stub-model",
|
||||
wallet_path=wallet_path,
|
||||
cache_dir=cache_dir,
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
# Wallet was created on disk
|
||||
@@ -1699,6 +1714,7 @@ def test_preset_model_startup_starts_heartbeat(tmp_path, monkeypatch):
|
||||
model="stub-model",
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
cache_dir=tmp_path / "shards",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
assert len(heartbeat_calls) == 1
|
||||
@@ -1739,6 +1755,7 @@ def test_preset_model_startup_honors_pinned_shard_range(tmp_path, monkeypatch):
|
||||
shard_end=5,
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
cache_dir=tmp_path / "shards",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
assert len(heartbeat_calls) == 1
|
||||
@@ -1782,6 +1799,7 @@ def test_preset_startup_rejects_pinned_shard_above_memory_budget(tmp_path, monke
|
||||
shard_end=39,
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
cache_dir=tmp_path / "shards",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
finally:
|
||||
tracker.stop()
|
||||
@@ -1835,6 +1853,7 @@ def test_network_auto_join_clips_oversized_cpu_assignment(tmp_path, monkeypatch,
|
||||
tracker_url="http://127.0.0.1:8080",
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
tracker_source_disabled=True,
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
assert torch_calls[0]["shard_start"] == 0
|
||||
@@ -1895,6 +1914,7 @@ def test_preset_model_with_hf_repo_loads_torch_backend(tmp_path, monkeypatch, ca
|
||||
model="tiny-llama",
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
cache_dir=tmp_path / "node-shards",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
assert len(torch_calls) == 1
|
||||
@@ -1972,6 +1992,7 @@ def test_torch_startup_retries_registration_when_tracker_unreachable(
|
||||
tracker_url=tracker_url,
|
||||
model_id="Qwen/Qwen2.5-0.5B-Instruct",
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
assert register_calls["count"] == 1
|
||||
@@ -2052,6 +2073,7 @@ def test_real_model_startup_registers_downloaded_inventory_without_checksum(
|
||||
model="tiny-llama",
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
cache_dir=tmp_path / "node-shards",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
assert len(hf_calls) == 1
|
||||
@@ -2342,6 +2364,7 @@ def test_startup_cpu_fallback(tmp_path, monkeypatch):
|
||||
model="stub-model",
|
||||
wallet_path=tmp_path / "wallet.json",
|
||||
cache_dir=tmp_path / "shards",
|
||||
capability_validator=assume_capability,
|
||||
)
|
||||
try:
|
||||
# Node is running even on CPU
|
||||
|
||||
Reference in New Issue
Block a user