test: isolate Docker bridge gateway fallback from host DNS (#5107)

* test: isolate Docker bridge gateway fallback from host DNS

Force the fallback-path test to bypass host DNS resolution.

Production bind-host behavior is unchanged.

Refs #5106

* test: document Docker fallback isolation

Explain why the fallback test must replace host DNS resolution.

Refs #5106
This commit is contained in:
luo jiyin 2026-08-30 22:24:32 +08:00 committed by GitHub
parent 11e6cdd7e7
commit 42796d7086
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -323,6 +323,7 @@ def test_start_container_brackets_bare_ipv6_bind_override(monkeypatch):
def test_start_container_binds_dood_port_to_bridge_gateway(monkeypatch):
"""Force resolver failure so host DNS cannot bypass the bridge-gateway fallback."""
backend = LocalContainerBackend(
image="sandbox:latest",
base_port=8080,
@ -332,6 +333,10 @@ def test_start_container_binds_dood_port_to_bridge_gateway(monkeypatch):
)
monkeypatch.setenv("DEER_FLOW_SANDBOX_HOST", "host.docker.internal")
monkeypatch.delenv("DEER_FLOW_SANDBOX_BIND_HOST", raising=False)
monkeypatch.setattr(
"deerflow.community.aio_sandbox.local_backend._resolve_sandbox_host_address",
lambda host: None,
)
monkeypatch.setattr(
"deerflow.community.aio_sandbox.local_backend._docker_bridge_gateway_ip",
lambda: "172.17.0.1",