From e50afdf67b11bedeeb140a9fa1aeee7ab5438e15 Mon Sep 17 00:00:00 2001 From: Sunny Wu Date: Fri, 20 Feb 2026 17:40:57 +1100 Subject: [PATCH] UID2-6621: Fix bore setup race condition and missing operator config guard Two bugs causing E2E test failures for all private operator types (AWS, GCP): 1. setup_bore.sh: Race condition where the shell's > redirect creates output files immediately (empty), so the until loop exits before the ekzhang/bore Docker image is pulled or outputs the tunnel URL. Fixed by waiting for actual content (" at ") in the files instead of just file existence. 2. prepare_resources_for_e2e_docker_compose.sh: The operator config file is only copied for public operators, but jq_string_update was called unconditionally for all operator types, causing a jq file-not-found error. Fixed by guarding the update with a file existence check. Co-Authored-By: Claude Sonnet 4.6 --- scripts/prepare_resources_for_e2e_docker_compose.sh | 4 +++- scripts/setup_bore.sh | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/prepare_resources_for_e2e_docker_compose.sh b/scripts/prepare_resources_for_e2e_docker_compose.sh index 29d043af..46997535 100644 --- a/scripts/prepare_resources_for_e2e_docker_compose.sh +++ b/scripts/prepare_resources_for_e2e_docker_compose.sh @@ -84,7 +84,9 @@ if [ ${OPERATOR_TYPE} != "public" ]; then jq_string_update ${DOCKER_OPTOUT_CONFIG_FILE} optout_url "${BORE_URL_OPTOUT}" fi -jq_string_update ${DOCKER_OPERATOR_CONFIG_FILE} identity_scope ${IDENTITY_SCOPE} +if [ -f "${DOCKER_OPERATOR_CONFIG_FILE}" ]; then + jq_string_update ${DOCKER_OPERATOR_CONFIG_FILE} identity_scope ${IDENTITY_SCOPE} +fi cat ${DOCKER_CORE_CONFIG_FILE} cat ${DOCKER_OPTOUT_CONFIG_FILE} diff --git a/scripts/setup_bore.sh b/scripts/setup_bore.sh index 6ac9d5c5..48a0c1e3 100755 --- a/scripts/setup_bore.sh +++ b/scripts/setup_bore.sh @@ -23,9 +23,11 @@ if [ "${TARGET_ENVIRONMENT}" == "mock" ]; then docker run --init --rm --network e2e_default ekzhang/bore local --local-host core --to ${BORE_URL} --secret ${BORE_SECRET} 8088 > ${ROOT}/bore_core.out & docker run --init --rm --network e2e_default ekzhang/bore local --local-host optout --to ${BORE_URL} --secret ${BORE_SECRET} 8081 > ${ROOT}/bore_optout.out & - until [ -f ${ROOT}/bore_localstack.out ] && [ -f ${ROOT}/bore_core.out ] && [ -f ${ROOT}/bore_optout.out ] + until grep -q " at " ${ROOT}/bore_localstack.out 2>/dev/null && \ + grep -q " at " ${ROOT}/bore_core.out 2>/dev/null && \ + grep -q " at " ${ROOT}/bore_optout.out 2>/dev/null do - sleep 5 + sleep 1 done cat ${ROOT}/bore_localstack.out