Skip to content

Commit 1fd4503

Browse files
authored
xds interop: Fix buildscripts not continuing on a failed test suite (#9833) (#9836)
Apparently there's a difference between bash 3 and bash 4. OSX comes with bash 3 out-of-box, so for whoever wrote this logic it "worked on my machine". The `((` construct returns a 0 exit code if the value is non-zero. Since the value starts at 0 and we do a post-increment, it will always fail the first time. Changing it to a pre-increment fixes the problem.
1 parent 899b02d commit 1fd4503

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

buildscripts/kokoro/psm-security.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ main() {
177177
local failed_tests=0
178178
test_suites=("baseline_test" "security_test" "authz_test")
179179
for test in "${test_suites[@]}"; do
180-
run_test $test || (( failed_tests++ ))
180+
run_test $test || (( ++failed_tests ))
181181
done
182182
echo "Failed test suites: ${failed_tests}"
183183
if (( failed_tests > 0 )); then

buildscripts/kokoro/xds_k8s_lb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ main() {
178178
local failed_tests=0
179179
test_suites=("api_listener_test" "change_backend_service_test" "failover_test" "remove_neg_test" "round_robin_test" "affinity_test" "outlier_detection_test" "custom_lb_test")
180180
for test in "${test_suites[@]}"; do
181-
run_test $test || (( failed_tests++ ))
181+
run_test $test || (( ++failed_tests ))
182182
done
183183
echo "Failed test suites: ${failed_tests}"
184184
if (( failed_tests > 0 )); then

0 commit comments

Comments
 (0)