Skip to content

Comments

UID2-6621: Fix bore setup race condition and missing operator config guard#202

Open
sunnywu wants to merge 1 commit intomainfrom
syw-UID2-6621-fix-bore-race-condition-and-operator-config
Open

UID2-6621: Fix bore setup race condition and missing operator config guard#202
sunnywu wants to merge 1 commit intomainfrom
syw-UID2-6621-fix-bore-race-condition-and-operator-config

Conversation

@sunnywu
Copy link
Contributor

@sunnywu sunnywu commented Feb 20, 2026

Summary

Fixes two bugs in the E2E shared scripts that caused all private operator E2E tests (AWS, GCP) to fail. Observed in run 22162906844.

Jira: UID2-6621

Bug 1: Race condition in setup_bore.sh

The bore Docker containers are launched in background with stdout redirected to files (> bore_core.out &). The shell's > redirect creates the output files immediately (empty) before Docker starts. The previous until [ -f file ] loop therefore exited instantly — before the ekzhang/bore image was pulled or bore output the tunnel URL — resulting in empty bore URLs output as http:// with no host/port.

Empty bore URLs cascaded into:

  • Docker Compose core container receiving http:// as its S3/KMS endpoints → core goes unhealthy
  • create_cloudformation_stack.py crashing with IndexError: list index out of range when parsing the port from http://

Fix: Wait for actual content in the bore output files (grep for " at " which appears in bore's tunnel URL line) instead of just file existence.

Bug 2: Missing file guard in prepare_resources_for_e2e_docker_compose.sh

The operator config file (./docker/uid2-operator/conf/local-e2e-docker-config.json) is only copied for OPERATOR_TYPE == public, but jq_string_update was called on it unconditionally for all operator types:

jq: error: Could not open file ./docker/uid2-operator/conf/local-e2e-docker-config.json: No such file or directory

For private operators (aws, gcp), the operator container runs externally (not in docker-compose), so the config file is not needed.

Fix: Guard the jq_string_update call with a file existence check.

Test plan

  • Verify the scheduled E2E run passes for GCP private operator
  • Verify the scheduled E2E run passes for AWS private operator (EUID AMI)

…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 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant