mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 14:12:00 +08:00
[core] Better support multi-nic environments by respecting user-provided IP (#8512)
This commit is contained in:
@@ -8,6 +8,8 @@ import time
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import ray
|
||||
import ray.cluster_utils
|
||||
import ray.test_utils
|
||||
@@ -673,6 +675,15 @@ def test_internal_config_when_connecting(ray_start_cluster):
|
||||
ray.get(oid)
|
||||
|
||||
|
||||
def test_get_correct_node_ip():
|
||||
with patch("ray.worker") as worker_mock:
|
||||
node_mock = MagicMock()
|
||||
node_mock.node_ip_address = "10.0.0.111"
|
||||
worker_mock._global_node = node_mock
|
||||
found_ip = ray.services.get_node_ip_address()
|
||||
assert found_ip == "10.0.0.111"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import pytest
|
||||
sys.exit(pytest.main(["-v", __file__]))
|
||||
|
||||
Reference in New Issue
Block a user