feat(controller-peers-env-fallback): create the regression script skeleton (task 1.3)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-03 05:36:49 +00:00
parent d4858e1fe9
commit 241ed3a142
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
2 changed files with 363 additions and 1 deletions

View file

@ -14,7 +14,7 @@
- Done when the libxce suite passes with all seven cases
- _Requirements: 1.6_
- [ ] 1.3 Create the regression script skeleton
- [x] 1.3 Create the regression script skeleton
- Test infrastructure for the scripted cases in later tasks; it satisfies no acceptance criterion by itself
- Create the repeatable regression script that later tasks add their cases to: take the build directory as an input and locate the built binaries in it, create a fresh scratch directory per daemon run, and provide helpers that run a binary with a given environment and arguments, wait for a line in a log file or captured stdout/stderr with a timeout, kill the process, and record pass/fail
- Pre-flight: fail with a message, rather than run, when a local cluster is up (something listening on port 9990, or the worker's fixed socket present) or a needed binary is missing
@ -126,3 +126,9 @@
- Done when both skill documents carry the notes at the listed locations
- _Requirements: 3.2, 3.3_
- _Boundary: skill docs_
## Implementation Notes
- (1.3) `verify-controller-peers-env.sh` unsets `XCE_CONTROLLER_PEERS` at startup; every case sets it explicitly. Exit 2 = usage/pre-flight refusal, 1 = a case failed. BusyBox `timeout` is in use here: a timed-out run exits 124 (coreutils) or 143 (BusyBox) — accept either.
- (1.3 → 3.3) `start_bg`/`run_to_completion` feed stdin from `/dev/null`, but `xce_test` reads its script only from stdin; add an optional stdin file to `run_to_completion` (e.g. `RUN_STDIN`) rather than the `sh -c 'exec "$0" --norc <"$1"'` workaround.
- (1.3 → 3.2) The worker's early "HA cluster config"/"No --peers flag" lines go to stdout before its log file is set up; confirm they are not stdio-buffered when stdout is a file (else `wait_for_line` on stdout times out while it runs) — wait for exit or use line buffering if so.
- (1.3) Drop the file-wide `shellcheck disable=SC2329,SC2034` once cases call the helpers, so real unused-variable warnings surface.