Skip to content

Commit 35ec2a1

Browse files
sjarmakclaude
andcommitted
fix: use trap EXIT for sg_only Dockerfile restore in smoke tests
The subshell restore logic failed when the smoke timed out — the kill signal terminated the subshell before restore_dockerfile() ran, leaving Dockerfile overwritten with sg_only content. Switch to trap EXIT which fires on any exit (normal, error, or signal kill). Also cleaned up leftover Dockerfile.original backup and restored camel-fix-protocol-feat-001/Dockerfile to its 1-line baseline. Root cause of the camel smoke_verify_timeout: the sg_only variant does cp -a + find/truncate + git commit on a 2.8M LOC Java repo, which exceeds the 600s smoke timeout. This is expected — actual benchmark runs have build_timeout_sec=1800. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a98564c commit 35ec2a1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

configs/validate_one_per_benchmark.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,19 +212,17 @@ for line in "${TASK_LINES[@]}"; do
212212
echo "Launching runtime smoke: $bm ($path)"
213213
fi
214214

215-
# Run smoke in a subshell that restores the Dockerfile on exit
215+
# Run smoke in a subshell with trap-based restore (survives timeout kills)
216216
(
217+
if [ "$__sg_swapped" = true ]; then
218+
trap 'restore_dockerfile "'"$abs_path"'"' EXIT
219+
fi
217220
python3 scripts/validate_tasks_preflight.py \
218221
--task "$abs_path" \
219222
--smoke-runtime \
220223
--smoke-timeout-sec "$TASK_TIMEOUT" \
221224
--format json \
222225
> "$JOBS_DIR/${bm}.log" 2>&1
223-
__rc=$?
224-
if [ "$__sg_swapped" = true ]; then
225-
restore_dockerfile "$abs_path"
226-
fi
227-
exit $__rc
228226
) &
229227
else
230228
echo "Launching harbor smoke: $bm ($path)"

0 commit comments

Comments
 (0)