Skip to content

Commit ee172c4

Browse files
DanMeonclaude
andcommitted
ci: sample 출력을 파일로 받아 artifact 업로드
이전 진단에서 sample 출력에 tail -400 을 걸어 자식 PID 의 Call graph 가 잘려 Binary Images 만 남았음. sample 의 -file 옵션으로 파일에 저장 → Call graph 부분만 awk 로 추출해 stdout 에 노출 + 전체 sample 파일은 actions/upload-artifact 로 업로드해 다운로드 후 분석 가능하게 함. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bb8a7e9 commit ee172c4

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ jobs:
187187
if: runner.os == 'macOS'
188188
env:
189189
RUST_BACKTRACE: full
190-
RUST_LOG: debug
191190
run: |
192191
set +e
192+
mkdir -p /tmp/diag
193193
uv run pytest tests/test_render_png.py::TestRenderPng::test_returns_png_magic -v -s &
194194
PYTEST_PID=$!
195195
# ^ 정상이면 분 단위 안에 끝남. 90초 wait 후 살아있으면 hang 으로 판정.
@@ -198,22 +198,34 @@ jobs:
198198
if ! kill -0 "$PYTEST_PID" 2>/dev/null; then
199199
wait "$PYTEST_PID"; EXIT=$?
200200
echo "pytest 종료 in ~$((i*10))s exit=$EXIT"
201-
# 정상 종료라면 나머지 테스트도 돌려서 회귀 가드
202201
if [ "$EXIT" = "0" ]; then
203202
exec uv run pytest tests/ -m "not slow" -v
204203
fi
205204
exit $EXIT
206205
fi
207206
done
208207
echo "=== HANG DETECTED — sampling native stacks ==="
208+
# ^ 자식까지 포함 (uv → python pytest). sample 출력을 파일로 받아 artifact 업로드.
209209
PIDS="$PYTEST_PID $(pgrep -P "$PYTEST_PID" || true)"
210210
for PID in $PIDS; do
211211
kill -0 "$PID" 2>/dev/null || continue
212-
echo "----- sample PID=$PID (20s) -----"
213-
sample "$PID" 20 2>&1 | tail -400 || true
212+
OUT="/tmp/diag/sample_${PID}.txt"
213+
echo "----- sampling PID=$PID → $OUT -----"
214+
sample "$PID" 15 -file "$OUT" 2>&1 | head -3
215+
echo ">>> Call graph head (PID=$PID) <<<"
216+
awk '/^Call graph:/,/^Binary Images:/' "$OUT" 2>/dev/null | head -120 || echo "(파일 미생성)"
217+
echo
214218
done
219+
ls -la /tmp/diag/
215220
kill -9 "$PYTEST_PID" 2>/dev/null
216221
exit 1
222+
- name: Upload sample diagnostic artifacts
223+
if: always() && runner.os == 'macOS'
224+
uses: actions/upload-artifact@v4
225+
with:
226+
name: macos-png-hang-samples
227+
path: /tmp/diag/
228+
if-no-files-found: warn
217229

218230
# * PDF 렌더링 — 느려서 별도 잡, Linux wheel 재사용
219231
test-slow:

0 commit comments

Comments
 (0)