continuous-integration
continuous-integration copied to clipboard
Migrating to Zonal DNS causes bazel_sandboxing_test to fail
When setting VmDnsSettings=ZonalOnly
in our GCE project, this test fails:
** test_sandbox_can_resolve_own_hostname ***************************************
-- Test log: -----------------------------------------------------------
$TEST_TMPDIR defined: output root default is '/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/execroot/io_bazel/_tmp/f3e0213ba37051bb8f392dea4c875d9c' and max_idle_secs default is '15'.
WARNING: Streamed test output requested. All tests will be run locally, without sharding, one at a time
Loading:
Loading: 0 packages loaded
Analyzing: target //src/test/java/com/example:HostNameTest (1 packages loaded, 0 targets configured)
INFO: Analyzed target //src/test/java/com/example:HostNameTest (23 packages loaded, 367 targets configured).
INFO: Found 1 test target...
[0 / 4] [Prepa] BazelWorkspaceStatusAction stable-status.txt
[8 / 11] Action external/bazel_tools/tools/jdk/platformclasspath.jar; 1s linux-sandbox
[9 / 11] Building src/test/java/com/example/HostNameTest.jar (1 source file); 0s linux-sandbox
JUnit4 Test Runner
.E
Time: 0.046
There was 1 failure:
1) testGetHostName(com.example.HostNameTest)
java.net.UnknownHostException: bk-docker-vtwd: bk-docker-vtwd: Name or service not known
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1642)
at com.example.HostNameTest.testGetHostName(HostNameTest.java:13)
... 25 trimmed
Caused by: java.net.UnknownHostException: bk-docker-vtwd: Name or service not known
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:929)
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1515)
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:848)
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1505)
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1637)
... 27 more
FAILURES!!!
Tests run: 1, Failures: 1
Links:
- https://storage.googleapis.com/bazel-untrusted-buildkite-artifacts/ca4a96d6-19df-45f4-9ef6-1072bf75fed0/src/test/shell/bazel/bazel_sandboxing_test/attempt_1.log
- https://buildkite.com/bazel/bazel-bazel/builds/13731#ca4a96d6-19df-45f4-9ef6-1072bf75fed0