fix(compose): smoke matrix가 실패한 단계를 무시하지 않게 한다
문제: scripts/run-compose-runtime-smoke.sh --matrix는 lane마다 `if ( trap cleanup_lane EXIT; run_lane ... )`로 돈다. bash는 if 조건으로 도는 명령 안에서(함수·subshell 포함) set -e를 끈다. 그래서 명시적으로 `return 1` 하지 않는 단계 — 계약 검사, config, 이미지 build, create, up --wait — 의 실패가 무시된다. 2026-11-07 최종 게이트에서 이미지 build가 실패했는데(7305ab38이 고친 결함), lane은 두 시간 전에 만든 이미지로 떠서 18개 모두 "passed"였다. --lane 모드는 run_lane을 직접 불러 영향이 없었다. 고른 방법: lane을 `set -e`를 켠 subshell에서 돌리고, 끝난 뒤 그 상태를 읽는다(if 조건으로 부르지 않는다). --lane 모드와 같은 동작이 된다. 버린 대안: 단계마다 `|| return 1`을 붙이기. 새 단계를 더할 때마다 다시 빠뜨리기 쉽다. 위험·한계: 지금까지 무시되던 단계의 실패가 이제 lane 실패가 된다. 그것이 목적이다. 검증(desktop ~/workspace/t1-final, ~/t1-layout-logs/): - RED: 이미지 build가 깨진 트리(e13a2902)에서 이 수정만 얹고 off-local 한 lane matrix: rc=1, "1 lane(s) failed: off-local" (red-smoke-buildfail.log). 수정 전 같은 트리의 18 lane matrix는 build 실패를 무시하고 rc=0(final/final-smoke.log) - 고친 뒤(트리31466b8e= 이 커밋): run-compose-runtime-smoke.sh --matrix 18 lane rc=0(693초). 이미지를 새로 빌드했고(build.log ERROR 0), 모든 lane 컨테이너 재시작 0. 같은 트리에서 :ci, :mainCheck, scripts/bootstrap-local.sh, releaseCheck(두 빌드) rc=0 (~/t1-layout-logs/final/final2-summary.txt) Fixes:50cd7154d0("refactor(compose)!: compose 파일을 개발 환경 하나와 lane fixture로 나눈다")
This commit is contained in:
@@ -623,11 +623,22 @@ echo "running ${total} blocking lane(s), zero-skip"
|
||||
# script reported that all six had passed. A wrapper whose own success message is a false green is
|
||||
# worse than no wrapper, and nothing else here would have caught it: the count came from the
|
||||
# contract and the exit status from the one lane that did run.
|
||||
#
|
||||
# Each lane runs in a subshell with `set -e` on and its status read afterwards, never as an `if`
|
||||
# condition. Bash ignores `set -e` for every command run as part of an `if` condition, functions and
|
||||
# subshells included, so `if ( run_lane ... )` turned every step that relied on it into a step whose
|
||||
# failure was ignored. The image build was one: a build that failed left the lane to start the
|
||||
# previous run's image, and all eighteen lanes reported green on code the build had refused
|
||||
# (2026-11-07). --lane mode calls run_lane directly and was not affected.
|
||||
RAN_LANES=0
|
||||
while read -r -u 3 lane_json; do
|
||||
[[ -z "${lane_json}" ]] && continue
|
||||
RAN_LANES=$((RAN_LANES + 1))
|
||||
if ( trap cleanup_lane EXIT; run_lane "${lane_json}" ); then :; else
|
||||
set +e
|
||||
( set -e; trap cleanup_lane EXIT; run_lane "${lane_json}" )
|
||||
lane_status=$?
|
||||
set -e
|
||||
if [[ ${lane_status} -ne 0 ]]; then
|
||||
FAILED_LANES+=("$(jq -r '.id' <<<"${lane_json}")")
|
||||
fi
|
||||
done 3<<<"${blocking}"
|
||||
|
||||
Reference in New Issue
Block a user