Skip to content

Commit 5e4c1df

Browse files
committed
DEBUG: macOS julia-subfig and ua-missing-title probe (throwaway, do not merge)
1 parent 19a7da9 commit 5e4c1df

3 files changed

Lines changed: 104 additions & 1 deletion

File tree

‎.github/debug-julia-probe.sh‎

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/usr/bin/env bash
2+
# Throwaway probe: render julia-subfig variants on macOS under a watchdog.
3+
set -u
4+
cd tests
5+
tmo() { perl -e 'alarm shift; exec @ARGV' "$@"; }
6+
Q="$(command -v quarto)"
7+
echo "quarto: $Q"; "$Q" --version
8+
DBG="$RUNNER_TEMP/julia-probe"; mkdir -p "$DBG"
9+
D=docs/crossrefs
10+
cp $D/julia-subfig.qmd $D/zz-default.qmd
11+
cp $D/julia-subfig.qmd $D/zz-default-again.qmd
12+
cp $D/julia-subfig.qmd $D/zz-gksnul.qmd
13+
awk '{print} /^using Plots$/{print "Plots.gr(format=\"png\")"}' $D/julia-subfig.qmd > $D/zz-png.qmd
14+
# single display, default format
15+
cat > $D/zz-single.qmd <<'EOF'
16+
---
17+
title: single
18+
---
19+
20+
```{julia}
21+
using Plots
22+
plot([1,23,2,4]) |> display
23+
```
24+
EOF
25+
# no Plots at all: pure julia engine sanity check
26+
cat > $D/zz-noplots.qmd <<'EOF'
27+
---
28+
title: noplots
29+
---
30+
31+
```{julia}
32+
1 + 1
33+
```
34+
EOF
35+
36+
dump_state() {
37+
local name=$1
38+
echo "::group::HUNG $name - process table"
39+
ps -axo pid,ppid,etime,stat,%cpu,command | grep -i -E "julia|quarto|deno|gks|gr" | grep -v grep
40+
echo "::endgroup::"
41+
echo "::group::HUNG $name - julia engine status"
42+
tmo 30 "$Q" call engine julia status
43+
echo "::endgroup::"
44+
for p in $(pgrep -f "julia"); do
45+
echo "::group::sample $p"
46+
ps -o pid,command -p "$p"
47+
sample "$p" 3 2>/dev/null | head -150
48+
lsof -p "$p" 2>/dev/null | grep -v -E "\.(dylib|so|ji)" | tail -40
49+
echo "::endgroup::"
50+
done
51+
echo "::group::server log"
52+
find "$HOME" -name julia_server_log.txt -exec tail -200 {} \; 2>/dev/null
53+
echo "::endgroup::"
54+
}
55+
56+
run_variant() {
57+
local name=$1; shift
58+
echo "===== VARIANT $name ====="
59+
local start=$SECONDS
60+
( env "$@" "$Q" render "$D/$name.qmd" --to html > "$DBG/$name.log" 2>&1 ) &
61+
local pid=$!
62+
local waited=0
63+
while kill -0 $pid 2>/dev/null && [ $waited -lt 240 ]; do sleep 5; waited=$((waited+5)); done
64+
if kill -0 $pid 2>/dev/null; then
65+
dump_state "$name"
66+
pkill -TERM -P $pid; kill -TERM $pid
67+
tmo 30 "$Q" call engine julia kill
68+
echo "RESULT $name: HUNG (>240s)"
69+
else
70+
wait $pid; echo "RESULT $name: exit $? in $((SECONDS-start))s"
71+
fi
72+
echo "::group::$name render log"; cat "$DBG/$name.log"; echo "::endgroup::"
73+
}
74+
75+
run_variant zz-noplots
76+
run_variant zz-png
77+
run_variant zz-default
78+
run_variant zz-single
79+
run_variant zz-gksnul GKSwstype=nul
80+
run_variant zz-default-again
81+
run_variant julianative-subfig
82+
rm -f $D/zz-*.qmd $D/zz-*.html; rm -rf $D/zz-*_files
83+
exit 0
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: DEBUG macOS julia-subfig / ua-missing-title probe
2+
on:
3+
push:
4+
branches: [debug/macos-julia-subfig-probe]
5+
permissions:
6+
actions: write
7+
contents: read
8+
jobs:
9+
smoke-dev-macos:
10+
uses: ./.github/workflows/test-smokes.yml
11+
with:
12+
quarto-install: dev
13+
runners: '["macos-latest"]'
14+
buckets: '["smoke/crossref/figures.test.ts", "docs/smoke-all/pdf-standard/ua-missing-title.qmd"]'

‎.github/workflows/test-smokes.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,11 @@ jobs:
417417
quarto install tinytex
418418
419419
- name: Install veraPDF for PDF standard validation
420-
if: runner.os == 'Linux' && (format('{0}', inputs.buckets) == '' || contains(inputs.buckets, 'pdf-standard'))
420+
if: runner.os != 'Windows' && (format('{0}', inputs.buckets) == '' || contains(inputs.buckets, 'pdf-standard'))
421421
env:
422422
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
423423
run: |
424+
java -version || true
424425
quarto install verapdf
425426
426427
- name: Cache Typst packages
@@ -458,6 +459,11 @@ jobs:
458459
459460
- uses: ./.github/actions/merge-extension-tests
460461

462+
- name: DEBUG julia-subfig probe (macOS)
463+
if: runner.os == 'macOS'
464+
shell: bash
465+
run: bash .github/debug-julia-probe.sh
466+
461467
- name: Setup timing file for timed test
462468
if: ${{ matrix.time-test == true }}
463469
run: |

0 commit comments

Comments
 (0)