Skip to content

Commit 702118b

Browse files
meteorcloudycopybara-github
authored andcommitted
Remove --host_jvm_args=-Djava.net.preferIPv6Addresses=true
Bazel cannot reach to bcr.bazel.build from a ipv4 only machine with --host_jvm_args=-Djava.net.preferIPv6Addresses=true set. Our GCP VMs are ipv4 only and we recently enabled ipv6 for bcr.bazel.build. Related #21525 PiperOrigin-RevId: 611465054 Change-Id: I0c3d144d12ab167a18075e6719ff8597161798d1
1 parent c08d5ba commit 702118b

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ genrule(
107107
# Instead of `bazel mod deps`, we run a simpler command like `bazel query :all` here
108108
# so that we only trigger module resolution, not extension eval.
109109
# Also use `--batch` so that Bazel doesn't keep a server process alive.
110-
"$$ROOT/$(location //src:bazel) --batch --host_jvm_args=-Djava.net.preferIPv6Addresses=true --output_user_root=$$TMPDIR/output_user_root query --check_direct_dependencies=error --lockfile_mode=update :all",
110+
"$$ROOT/$(location //src:bazel) --batch --output_user_root=$$TMPDIR/output_user_root query --check_direct_dependencies=error --lockfile_mode=update :all",
111111
"mv MODULE.bazel.lock $$ROOT/$@",
112112
]),
113113
tags = ["requires-network"],

src/test/shell/bazel/bazel_test_test.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -708,12 +708,16 @@ exit 1
708708
EOF
709709
chmod +x true.sh flaky.sh false.sh
710710

711-
# The next two lines ensure that the test passes in IPv6-only networks.
712-
export JAVA_TOOL_OPTIONS="-Djava.net.preferIPv6Addresses=true"
713-
export STARTUP_OPTS="--host_jvm_args=-Djava.net.preferIPv6Addresses=true"
711+
# The next line ensures that the test passes in IPv6-only networks on macOS.
712+
if is_darwin; then
713+
export JAVA_TOOL_OPTIONS="-Djava.net.preferIPv6Addresses=true"
714+
export STARTUP_OPTS="--host_jvm_args=-Djava.net.preferIPv6Addresses=true"
715+
else
716+
export STARTUP_OPTS=""
717+
fi
714718

715719
# We do not use sandboxing so we can trick to be deterministically flaky
716-
bazel --ignore_all_rc_files "$STARTUP_OPTS" test --experimental_ui_debug_all_events \
720+
bazel --ignore_all_rc_files $STARTUP_OPTS test --experimental_ui_debug_all_events \
717721
--spawn_strategy=standalone //:flaky &> $TEST_log \
718722
|| fail "//:flaky should have passed with flaky support"
719723
[ -f "${FLAKE_FILE}" ] || fail "Flaky test should have created the flake-file!"
@@ -727,7 +731,7 @@ EOF
727731
cat bazel-testlogs/flaky/test.log &> $TEST_log
728732
assert_equals "pass" "$(awk "NR == $(wc -l < $TEST_log)" $TEST_log)"
729733

730-
bazel --ignore_all_rc_files "$STARTUP_OPTS" test --experimental_ui_debug_all_events //:pass \
734+
bazel --ignore_all_rc_files $STARTUP_OPTS test --experimental_ui_debug_all_events //:pass \
731735
&> $TEST_log || fail "//:pass should have passed"
732736
expect_log_once "PASS.*: //:pass"
733737
expect_log_once "PASSED"
@@ -736,7 +740,7 @@ EOF
736740
cat bazel-testlogs/flaky/test.log &> $TEST_log
737741
assert_equals "pass" "$(tail -1 bazel-testlogs/flaky/test.log)"
738742

739-
bazel --ignore_all_rc_files "$STARTUP_OPTS" test --experimental_ui_debug_all_events //:fail \
743+
bazel --ignore_all_rc_files $STARTUP_OPTS test --experimental_ui_debug_all_events //:fail \
740744
&> $TEST_log && fail "//:fail should have failed" \
741745
|| true
742746
expect_log_n "FAIL.*: //:fail (.*/fail/test_attempts/attempt_..log)" 2

0 commit comments

Comments
 (0)