From 70c5d034a888a8a812bd6e12a580bc911627bc99 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sat, 21 Nov 2026 18:20:04 +0100 Subject: [PATCH] CI mirror: run flutter shards at concurrency 2 At the default concurrency a shard peaked at 3.9 GiB and was OOM-killed inside capped.sh's 2 GiB scope; at 4 it still hit the limit now and then. At 2 a shard peaks at 1.8 GiB, about 22 s. Co-Authored-By: Claude Opus 5.5 --- app/pubspec.yaml | 2 +- scripts/ci_mirror.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 1229d48..1545827 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -2,7 +2,7 @@ name: diet_guard_app description: "Companion phone app for diet_guard: log meals on the go." publish_to: 'none' -version: 1.0.190+1 +version: 1.0.192+1 environment: sdk: ^3.12.2 diff --git a/scripts/ci_mirror.sh b/scripts/ci_mirror.sh index 9939a7e..f298c31 100755 --- a/scripts/ci_mirror.sh +++ b/scripts/ci_mirror.sh @@ -167,9 +167,13 @@ run_flutter_test_shard() { # 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 + # Two test isolates, not flutter's default of one per spare core: at the + # default a shard peaked at 3.9 GiB and was OOM-killed inside capped.sh's + # 2 GiB scope; at 4 it still hit 2 GiB and was killed now and then; at 2 + # it peaks at 1.8 GiB and runs in ~22 s (2026-11-21). + local tmp status=0 concurrency=${FLUTTER_TEST_CONCURRENCY:-2} tmp="$(mktemp -d "${XDG_CACHE_HOME:-$HOME/.cache}/diet-guard-flutter-test.XXXXXX")" - (cd "$APP_DIR" && TMPDIR="$tmp" flutter_clean_env test "${files[@]}") || status=$? + (cd "$APP_DIR" && TMPDIR="$tmp" flutter_clean_env test --concurrency="$concurrency" "${files[@]}") || status=$? rm -rf -- "$tmp" ((status == 0)) || fail "flutter test shard $index/$total" }