Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

TEMP: diagnose the intermittent ARM64 access violation in tests/view.rs

Brandon Thomas4ad43487ee86
diff --git a/.github/workflows/windows-arm64.yml b/.github/workflows/windows-arm64.yml
index bb05a3eb2..eddedf96c 100644
--- a/.github/workflows/windows-arm64.yml
+++ b/.github/workflows/windows-arm64.yml
@@ -124,3 +124,38 @@ jobs:
key: windows-arm64-test
- name: Test
run: cargo test --workspace --locked
+
+ # TEMPORARY (remove before merge): find the test in tests/view.rs that intermittently dies with
+ # STATUS_ACCESS_VIOLATION on ARM64. Single-threaded, so the last "test … " line names it.
+ diag-view:
+ name: diag view.rs crash (temporary)
+ runs-on: windows-11-arm
+ timeout-minutes: 120
+ steps:
+ - uses: actions/checkout@v4
+ - uses: dtolnay/rust-toolchain@stable
+ - uses: Swatinem/rust-cache@v2
+ with:
+ key: windows-arm64-test
+ - name: Build the view tests
+ run: cargo test -p printcraft-ui-egui --test view --no-run
+ - name: Run them 30 times, single-threaded
+ shell: bash
+ run: |
+ crashes=0
+ for i in $(seq 1 30); do
+ if ! cargo test -q -p printcraft-ui-egui --test view -- --test-threads=1 --nocapture > run.log 2>&1; then
+ crashes=$((crashes+1))
+ echo "::warning::run $i failed; last tests started:"
+ grep -E "^test |STATUS_|panicked" run.log | tail -4
+ fi
+ done
+ echo "crashes: $crashes / 30"
+ - name: Each test alone, 15 times
+ shell: bash
+ run: |
+ for t in $(cargo test -q -p printcraft-ui-egui --test view -- --list 2>/dev/null | sed -n 's/: test$//p'); do
+ n=0
+ for i in $(seq 1 15); do cargo test -q -p printcraft-ui-egui --test view -- --exact "$t" > one.log 2>&1 || n=$((n+1)); done
+ echo "$t: $n / 15 failed"
+ done