fix(e2e): bounded retry around external workspace-create in staging concierge user_tasks (#2743) #2746

Merged
devops-engineer merged 1 commits from fix/2743-staging-concierge-create-retry into main 2026-06-13 10:20:13 +00:00
Member

What

Bounded retry around the external workspace-create only in the staging concierge user_tasks E2E (tests/e2e/test_staging_concierge_e2e.sh).

Root cause (issue #2743, Researcher RCA — confirmed)

main 6163f6636fc8 was red in run 358767 / job 487991 before any user_tasks assertion:

  • CURL_COMMON=(-sS --max-time 30) (line 95) is inherited by tenant_call (lines 215-220).
  • create_external_ws did a single POST /workspaces (lines 223-231) and regex-parsed id.
  • Under staging control-plane latency the create stalled >30s, curl exited rc=28 (curl: (28) Operation timed out after 30002 milliseconds), no id was parsed, and [ -n "$WS_A" ] || fail "ws-A create returned no id" (line ~258) hard-failed step 4 immediately.

The external create still runs a DB transaction + post-commit token/status work before returning 201, so it is in the same provisioning-latency class as slow workspace boots — harness flake, not a user_tasks contract failure.

Fix

create_external_ws now retries the external-row create only:

  • Default 5 attempts (CREATE_WS_ATTEMPTS), longer per-call --max-time 90 (CREATE_WS_MAX_TIME) that wins over CURL_COMMON's 30s, short linear backoff.
  • Retries transient cases only: rc=28 timeout, connection error (http 000), or 2xx-but-no-id.
  • Semantic 4xx/5xx stay hard-red immediately with the response body.
  • Exhausted retries fail loudly with the captured curl rc + HTTP code (named mechanism: "rc=28 class" — no silent pass, no blind number bump).
  • Mirrors the harness's existing set +e / $?-capture (mcp_call) and eventual-consistency poll style; longer --max-time mirrors the teardown DELETE's --max-time 120.

Scope is intentionally narrow — no retries added anywhere else.

Validation

Real-staging-infra E2E (needs staging CP creds) — not runnable locally. Validated locally on the operator:

  • bash -n tests/e2e/test_staging_concierge_e2e.shOK (rc=0)
  • shellcheck (default + -S warning) → clean, 0 findings

Authoritative validation is CI re-running the staging suite on this PR — not claimed from local reasoning.

Other two reds on run 358767 — assessment (independent, NOT this root)

Both run a different script (test_staging_full_saas.sh, which does not use create_external_ws) and fail far past workspace creation, in the A2A canary phase:

  • E2E Staging Platform Boot (job 487990): provisioning → running, parent workspace created OK, then ❌ A2A known-answer queue poll timed out. A2A agent-response timeout — not a create timeout.
  • E2E Staging SaaS (job 487989): provisioning + parent and child creates all succeeded, then ❌ A2A — STAGING LLM/BACKEND/RUNTIME FAILURE (_ResultError) (canary agent surfaced an LLM/backend/runtime error).

These do not share the rc=28 external-create root and are not covered by this fix. They look like staging LLM/backend/runtime + agent-completion latency in a separate path — re-run vs separate-fix is a judgment call for the owner; flagging, not expanding scope.

Closes #2743

🤖 Generated with Claude Code

## What Bounded retry around the **external workspace-create only** in the staging concierge `user_tasks` E2E (`tests/e2e/test_staging_concierge_e2e.sh`). ## Root cause (issue #2743, Researcher RCA — confirmed) main `6163f6636fc8` was red in run 358767 / job 487991 **before any `user_tasks` assertion**: - `CURL_COMMON=(-sS --max-time 30)` (line 95) is inherited by `tenant_call` (lines 215-220). - `create_external_ws` did a single `POST /workspaces` (lines 223-231) and regex-parsed `id`. - Under staging control-plane latency the create stalled >30s, curl exited **rc=28** (`curl: (28) Operation timed out after 30002 milliseconds`), no `id` was parsed, and `[ -n "$WS_A" ] || fail "ws-A create returned no id"` (line ~258) hard-failed step 4 immediately. The external create still runs a DB transaction + post-commit token/status work before returning `201`, so it is in the **same provisioning-latency class** as slow workspace boots — harness flake, not a `user_tasks` contract failure. ## Fix `create_external_ws` now retries the external-row create **only**: - Default **5 attempts** (`CREATE_WS_ATTEMPTS`), longer per-call **`--max-time 90`** (`CREATE_WS_MAX_TIME`) that wins over `CURL_COMMON`'s 30s, short linear backoff. - Retries **transient** cases only: rc=28 timeout, connection error (http `000`), or 2xx-but-no-id. - **Semantic 4xx/5xx stay hard-red immediately** with the response body. - Exhausted retries **fail loudly** with the captured curl rc + HTTP code (named mechanism: "rc=28 class" — no silent pass, no blind number bump). - Mirrors the harness's existing `set +e` / `$?`-capture (`mcp_call`) and eventual-consistency poll style; longer `--max-time` mirrors the teardown DELETE's `--max-time 120`. Scope is intentionally narrow — no retries added anywhere else. ## Validation Real-staging-infra E2E (needs staging CP creds) — **not runnable locally**. Validated locally on the operator: - `bash -n tests/e2e/test_staging_concierge_e2e.sh` → **OK (rc=0)** - `shellcheck` (default + `-S warning`) → **clean, 0 findings** Authoritative validation is CI re-running the staging suite on this PR — not claimed from local reasoning. ## Other two reds on run 358767 — assessment (independent, NOT this root) Both run a **different** script (`test_staging_full_saas.sh`, which does not use `create_external_ws`) and fail **far past** workspace creation, in the A2A canary phase: - **`E2E Staging Platform Boot` (job 487990)**: provisioning `→ running`, parent workspace created OK, then `❌ A2A known-answer queue poll timed out`. A2A agent-response timeout — not a create timeout. - **`E2E Staging SaaS` (job 487989)**: provisioning + parent **and** child creates all succeeded, then `❌ A2A — STAGING LLM/BACKEND/RUNTIME FAILURE (_ResultError)` (canary agent surfaced an LLM/backend/runtime error). These do **not** share the rc=28 external-create root and are **not** covered by this fix. They look like staging LLM/backend/runtime + agent-completion latency in a separate path — re-run vs separate-fix is a judgment call for the owner; flagging, not expanding scope. Closes #2743 🤖 Generated with [Claude Code](https://claude.com/claude-code)
devops-engineer added 1 commit 2026-06-13 10:17:12 +00:00
fix(e2e): bounded retry around external workspace-create in staging concierge user_tasks (#2743)
CI / Python Lint & Test (pull_request) Successful in 5s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 6s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / detect-changes (pull_request) Successful in 10s
sop-checklist / review-refire (pull_request_target) Has been skipped
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 7s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 8s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 12s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Has been skipped
E2E API Smoke Test / detect-changes (pull_request) Successful in 17s
gate-check-v3 / gate-check (pull_request_target) Failing after 12s
CI / Detect changes (pull_request) Successful in 20s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2s
sop-checklist / all-items-acked (pull_request_target) Successful in 11s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 6s
E2E Chat / detect-changes (pull_request) Successful in 21s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 18s
CI / Platform (Go) (pull_request) Successful in 3s
CI / Canvas (Next.js) (pull_request) Successful in 2s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 24s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 20s
CI / Canvas Deploy Status (pull_request) Successful in 1s
E2E Chat / E2E Chat (pull_request) Successful in 4s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 28s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 31s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 49s
CI / all-required (pull_request) Successful in 3s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m20s
reserved-path-review / reserved-path-review (pull_request_review) Successful in 7s
qa-review / approved (pull_request_target) Approved via pull_request_review trigger
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
sop-checklist / na-declarations (pull_request) N/A: (none)
qa-review / approved (pull_request_review) Successful in 10s
security-review / approved (pull_request_target) Approved via pull_request_review trigger
security-review / approved (pull_request_review) Successful in 11s
audit-force-merge / audit (pull_request_target) Successful in 7s
E2E Staging SaaS (full lifecycle) / pr-validate (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging SaaS (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Platform Boot (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge user_tasks (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Workspace Requests (core#2606) (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge Creates Workspace (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge (compile+skip) (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge Platform Agent (pull_request) Waiting to run
bb7aa54116
The staging concierge user_tasks E2E hard-failed before any assertion when the
one-shot external workspace-create curl hit CURL_COMMON --max-time 30 and exited
rc=28 (curl: (28) Operation timed out), leaving no id to parse. The external
create still runs a DB transaction + post-commit token/status work before
returning 201, so it is in the same provisioning-latency class as slow boots and
should not fail the test as a contract violation.

create_external_ws now retries the external-row create only (default 5 attempts)
on transient cases -- rc=28 timeout, connection error (http 000), or 2xx-with-no-id
-- with a longer per-call --max-time (90s, mirroring the teardown DELETE
--max-time 120) and short linear backoff. Semantic 4xx/5xx stay hard-red
immediately with the response body; exhausted retries fail loudly with the
captured curl rc + HTTP code. Mirrors the harness's existing set +e / rc capture
(mcp_call) and eventual-consistency poll style.

Closes #2743

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
agent-reviewer-cr2 approved these changes 2026-06-13 10:19:58 +00:00
agent-reviewer-cr2 left a comment
Member

5-axis review on head bb7aa54116. Correctness: the diff is scoped to create_external_ws in tests/e2e/test_staging_concierge_e2e.sh and addresses the rc=28 external-create flake without broadening retries elsewhere. Robustness: retries are bounded, use a longer per-call max-time, and only continue for transient/no-result cases; semantic 4xx/5xx responses fail immediately with response context, while exhausted retries fail loudly with the last curl rc and HTTP code. Security: no auth/token handling or new secret output beyond existing staging harness response snippets. Performance: 5 attempts with linear short backoff is acceptable for a staging E2E harness and avoids busy-looping. Readability: the helper comments explain the retry class and preserve the existing shell style. CI/all-required is green; staging suite validation remains CI-owned as documented.

5-axis review on head bb7aa54116f38acb1319dcb6cdc6ef2cf0337159. Correctness: the diff is scoped to `create_external_ws` in `tests/e2e/test_staging_concierge_e2e.sh` and addresses the rc=28 external-create flake without broadening retries elsewhere. Robustness: retries are bounded, use a longer per-call max-time, and only continue for transient/no-result cases; semantic 4xx/5xx responses fail immediately with response context, while exhausted retries fail loudly with the last curl rc and HTTP code. Security: no auth/token handling or new secret output beyond existing staging harness response snippets. Performance: 5 attempts with linear short backoff is acceptable for a staging E2E harness and avoids busy-looping. Readability: the helper comments explain the retry class and preserve the existing shell style. CI/all-required is green; staging suite validation remains CI-owned as documented.
Member

/sop-ack

/sop-ack
devops-engineer merged commit 0dd269e80e into main 2026-06-13 10:20:13 +00:00
Member

APPROVED (post-merge 5-axis review) on head bb7aa54116.

Correctness: the retry is scoped to create_external_ws in tests/e2e/test_staging_concierge_e2e.sh, exactly matching #2743: the prior one-shot external workspace create could timeout with curl rc=28 and return no id before any user_tasks assertions. The new helper retries transient rc=28/http000/2xx-no-id cases with bounded attempts and a longer per-call timeout, while semantic 4xx/5xx responses still hard-fail immediately with the response body.

Risk/behavior: this does not weaken the user_tasks contract assertions or broadly hide staging failures; it only absorbs provisioning-latency flake on the setup row-create step. The final failure message preserves rc/http context. Scope is one E2E shell script. CI all-required is green on the head; PR was already merged before my formal review, so this is an audit-trail approval. /sop-ack

APPROVED (post-merge 5-axis review) on head bb7aa54116f38acb1319dcb6cdc6ef2cf0337159. Correctness: the retry is scoped to `create_external_ws` in `tests/e2e/test_staging_concierge_e2e.sh`, exactly matching #2743: the prior one-shot external workspace create could timeout with curl rc=28 and return no id before any user_tasks assertions. The new helper retries transient rc=28/http000/2xx-no-id cases with bounded attempts and a longer per-call timeout, while semantic 4xx/5xx responses still hard-fail immediately with the response body. Risk/behavior: this does not weaken the user_tasks contract assertions or broadly hide staging failures; it only absorbs provisioning-latency flake on the setup row-create step. The final failure message preserves rc/http context. Scope is one E2E shell script. CI all-required is green on the head; PR was already merged before my formal review, so this is an audit-trail approval. /sop-ack
Sign in to join this conversation.
No Reviewers
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2746