Skip to content

Commit c211184

Browse files
committed
Try forcing same zone as kokoro worker
1 parent e4671fc commit c211184

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

kokoro/scripts/test/go_test.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,17 @@ if [[ -n "${PLATFORMS:-}" ]]; then
143143
IMAGE_SPECS="${PLATFORMS}"
144144
fi
145145

146+
# TODO(b/502589964): force test VMs to run in the same zone as the kokoro worker.
147+
# The worker is not guaranteed to run in a zone where ARM machines are available,
148+
# so don't do this for ARM tests.
149+
if [[ "${ARCH:-}" != "aarch64" ]]; then
150+
ZONE_METADATA=$(curl -s -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/instance/zone)
151+
if [[ $? -eq 0 ]] && [[ -n "$ZONE_METADATA" ]]; then
152+
ZONE_METADATA="${ZONE_METADATA%/}"
153+
export ZONES="${ZONE_METADATA##*/}"
154+
fi
155+
fi
156+
146157
set_image_specs
147158
set_zones
148159

0 commit comments

Comments
 (0)