Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.1.0] Remove --host_jvm_args=-Djava.net.preferIPv6Addresses=true #21546

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ genrule(
# Instead of `bazel mod deps`, we run a simpler command like `bazel query :all` here
# so that we only trigger module resolution, not extension eval.
# Also use `--batch` so that Bazel doesn't keep a server process alive.
"$(location //src:bazel) --batch --host_jvm_args=-Djava.net.preferIPv6Addresses=true --output_user_root=$$PWD/tmp_bazel_root query --check_direct_dependencies=error --lockfile_mode=update :all && " +
"$(location //src:bazel) --batch --output_user_root=$$PWD/tmp_bazel_root query --check_direct_dependencies=error --lockfile_mode=update :all && " +
"mv MODULE.bazel.lock $@",
tags = ["requires-network"],
tools = ["//src:bazel"],
Expand Down
16 changes: 10 additions & 6 deletions src/test/shell/bazel/bazel_test_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,16 @@ exit 1
EOF
chmod +x true.sh flaky.sh false.sh

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

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

bazel --ignore_all_rc_files "$STARTUP_OPTS" test --experimental_ui_debug_all_events //:pass \
bazel --ignore_all_rc_files $STARTUP_OPTS test --experimental_ui_debug_all_events //:pass \
&> $TEST_log || fail "//:pass should have passed"
expect_log_once "PASS.*: //:pass"
expect_log_once "PASSED"
Expand All @@ -733,7 +737,7 @@ EOF
cat bazel-testlogs/flaky/test.log &> $TEST_log
assert_equals "pass" "$(tail -1 bazel-testlogs/flaky/test.log)"

bazel --ignore_all_rc_files "$STARTUP_OPTS" test --experimental_ui_debug_all_events //:fail \
bazel --ignore_all_rc_files $STARTUP_OPTS test --experimental_ui_debug_all_events //:fail \
&> $TEST_log && fail "//:fail should have failed" \
|| true
expect_log_n "FAIL.*: //:fail (.*/fail/test_attempts/attempt_..log)" 2
Expand Down
Loading