Skip to content

fix(tests): run create_cluster in a timeout-able bash in e2e-journey#316

Merged
divyasinghds merged 1 commit into
developfrom
fix/e2e-journey-create-cluster-guard
Jul 7, 2026
Merged

fix(tests): run create_cluster in a timeout-able bash in e2e-journey#316
divyasinghds merged 1 commit into
developfrom
fix/e2e-journey-create-cluster-guard

Conversation

@saadqbal

@saadqbal saadqbal commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What

scripts/tests/e2e-journey.sh step 1 failed on develop with:

timeout: failed to run command 'create_cluster': No such file or directory
exit code 127

The guard() watchdog added in #310/#311 wraps each step in timeout. timeout execs an external command in a fresh process and cannot see shell functions — and create_cluster is a function sourced from scripts/lib/cluster.sh. So the very first guarded step aborted before the cluster was ever created, failing the E2E last-mile journey (amd64) check (e.g. on #309).

Fix

Run create_cluster inside a real bash (which timeout can exec) that re-sources the libs:

guard 600 "create_cluster" -- bash -c '
  set -euo pipefail
  source "$1/common.sh"; source "$1/setup-linux.sh"; source "$1/cluster.sh"
  create_cluster' _ "$LIB"
  • Exported CLUSTER_NAME / TRACEBLOC_NO_AUTOSTART / USER carry through the env.
  • The CLI binaries install_* dropped into /usr/local/bin are on the inherited PATH.
  • The existing guard() negative-control self-test still validates the timeout mechanics (it guards sh -c 'exit 7', a real binary).

Verified locally: script parses (bash -n) and create_cluster resolves inside the re-sourcing subshell.

Refs #310

🤖 Generated with Claude Code


Note

Low Risk
Test harness-only change; no production installer or cluster logic modified.

Overview
Fixes E2E last-mile journey step 1 failing immediately with timeout: failed to run command 'create_cluster' (exit 127) after the guard() watchdog started wrapping steps in GNU timeout.

guard passes its command to timeout, which only runs real executables—not shell functions like create_cluster from cluster.sh. Step 1 now runs bash -c that re-sources common.sh, setup-linux.sh, and cluster.sh, then calls create_cluster, with $LIB passed as _ so sourcing still works under timeout.

Exported env (CLUSTER_NAME, TRACEBLOC_NO_AUTOSTART, USER) and PATH from prior install_* steps are unchanged; inline comments document why the indirection is required. Other guarded steps already use binaries (kubectl, curl, sh, etc.) and are unaffected.

Reviewed by Cursor Bugbot for commit 528d8d4. Bugbot is set up for automated code reviews on this repo. Configure here.

The guard() watchdog added in #310/#311 wraps steps in `timeout`, which
execs an external command in a fresh process and cannot see shell
functions. create_cluster is a function sourced from cluster.sh, so
`guard 600 "create_cluster" -- create_cluster` failed with
"timeout: failed to run command 'create_cluster': No such file or
directory" (exit 127) before the cluster was ever created — failing the
E2E last-mile journey job.

Run create_cluster inside a real `bash` (which timeout CAN exec) that
re-sources the libs. Exported CLUSTER_NAME / TRACEBLOC_NO_AUTOSTART /
USER carry through the env, and the CLI binaries install_* dropped into
/usr/local/bin are on the inherited PATH.

Refs #310

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@saadqbal saadqbal self-assigned this Jul 7, 2026
@divyasinghds divyasinghds merged commit 4d76021 into develop Jul 7, 2026
35 checks passed
@divyasinghds divyasinghds deleted the fix/e2e-journey-create-cluster-guard branch July 7, 2026 13:29
saadqbal added a commit that referenced this pull request Jul 7, 2026
… --dry-run (#318)

Step 4 only ran for real once #316 fixed the create_cluster exit-127
regression (the old vacuous guard() and then the step-1 crash had hidden
it). It failed with "table name is required (set --table)".

`dataset push --dry-run` is no longer an offline check: the current CLI
runs cluster discovery AND a Bound-PVC check (resolveClusterTarget with
needPVC=true) before its dry-run stop, and this harness's credential-free
stub creates no PVC — so that path can't pass here regardless of flags.

Switch to `tracebloc data validate <spec>`, the CLI's purpose-built
offline schema check (validates against the embedded ingest.v1.json, no
cluster) — exactly the "offline-validatable, no creds, no reachable
platform" smoke the step was always meant to be. Assert both directions
(valid spec passes, invalid spec rejected) so a green run isn't vacuous,
mirroring the guard() self-test. Spec shape matches the CLI's own
known-good fixture (testdata/smoke/valid-image-classification.yaml).

Verified against the real released binary (tracebloc/cli v0.6.0, which
releases/latest resolves to): valid -> exit 0, missing-intent -> exit 2.

Closes #317. Follow-up to #316 / #310.

Co-authored-by: Claude Opus 4.8 <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.

3 participants