forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

stress-mp4-fixtures.sh33 lines, 1.2 KiBHistoryRawDownload
1#!/usr/bin/env bash
2# stress-mp4-fixtures.sh: the multi-crate test command that once flaked on
3# ec-mp4's fragmented-file test, run three times plus once at --test-threads=16.
4# Every run starts from a cold fixture work directory (the derived mp4/mkv
5# fixtures are made on first use), because the race only exists while those
6# files are being written. Run it through scripts/remote-run.sh, which sets TMPDIR.
7#
8# scripts/remote-run.sh mp4fixturerace --host auto -- scripts/stress-mp4-fixtures.sh
9#
10# Exit 0 only if every run passes. Logs go to $TMPDIR/stress-mp4-<n>.log.
11
12set -uo pipefail
13: "${TMPDIR:=/tmp}"
14CRATES=(-p ec-h265 -p ec-vorbis -p ec-probe -p ec-ac3 -p oxideav-ac3 -p ec-mp4 -p ec-image -p ec-alac -p ec-mp3 -p ec-ogg)
15
16fail=0
17run() {
18 local n=$1; shift
19 rm -rf "$TMPDIR/ec-mp4-tests" "$TMPDIR/ec-matroska-tests"
20 if cargo test --release "${CRATES[@]}" "$@" >"$TMPDIR/stress-mp4-$n.log" 2>&1; then
21 echo "run $n ($*): PASS"
22 else
23 echo "run $n ($*): FAIL, see $TMPDIR/stress-mp4-$n.log"
24 grep -E "panicked|packet [0-9]+|FAILED|failures:" "$TMPDIR/stress-mp4-$n.log" | head -10
25 fail=1
26 fi
27}
28
29run 1
30run 2
31run 3
32run 4 -- --test-threads=16
33exit $fail