From e9424042132e657a2aed44cc2590f985e9647d88 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sat, 21 Nov 2026 15:40:55 +0100 Subject: [PATCH] CI mirror: give each flutter shard its own TMPDIR On the shared /tmp a shard stalled at ~2 s of CPU for 15+ minutes and held a build slot past 60 s. With a private TMPDIR every shard ends in 11-15 s. Co-Authored-By: Claude Opus 5.5 --- scripts/ci_mirror.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/ci_mirror.sh b/scripts/ci_mirror.sh index aaa7c8a..9939a7e 100755 --- a/scripts/ci_mirror.sh +++ b/scripts/ci_mirror.sh @@ -164,7 +164,14 @@ run_flutter_test_shard() { done < <(find "$APP_DIR/test" -name '*_test.dart' | LC_ALL=C sort) ((${#files[@]} > 0)) || fail "flutter test shard $index/$total has no test files" log "flutter test shard $index/$total (${#files[@]} files)" - (cd "$APP_DIR" && flutter_clean_env test "${files[@]}") || fail "flutter test shard $index/$total" + # A private TMPDIR per shard: on the shared /tmp a shard stalled at ~2 s of + # CPU for 15+ minutes (2026-11-21, held a build slot past 60 s) while the + # same shard with its own TMPDIR finished in well under a minute. + local tmp status=0 + tmp="$(mktemp -d "${XDG_CACHE_HOME:-$HOME/.cache}/diet-guard-flutter-test.XXXXXX")" + (cd "$APP_DIR" && TMPDIR="$tmp" flutter_clean_env test "${files[@]}") || status=$? + rm -rf -- "$tmp" + ((status == 0)) || fail "flutter test shard $index/$total" } # No phase argument (or pytest options) runs everything, exactly as CI does.